Spontaneously broken, flavour-dependent, gauged $U(1)$ extensions of the Standard Model (SM) have many phenomenological uses. We chart the space of solutions to the gauge anomaly cancellation equations in such extensions, for both the SM chiral fermion content and the SM plus (up to) three right-handed neutrinos (SM$ u_R$). Methods from Diophantine analysis allow us to efficiently index the solutions arithmetically, and produce the complete solution space in particular cases. In order to solve the general case, we build a computer program which cycles through possible $U(1)$ charge assignments, providing all solutions for charges up to some pre-defined maximum absolute charge. Lists of anomaly-free $U(1)$ charge assignments result, which corroborate the results of our Diophantine analysis. We make these lists, which may be queried for further desirable properties, publicly available. This previously uncharted space of anomaly-free charge assignments has been little explored until now, paving the way for future model building and phenomenological studies.