In this article, the effective lengths of all q r -divisible linear codes over F q with a non-negative integer r are determined. For that purpose, the S q (r)-adic expansion of an integer n is introduced. It is shown that there exists a q r -divisible F q -linear code of effective length n if and only if the leading coefficient of the S q (r)-adic expansion of n is non-negative. Furthermore, the maximum weight of a q r -divisible code of effective length n is at most σ q r , where σ denotes the cross-sum of the S q (r)-adic expansion of n.This result has applications in Galois geometries. A recent theorem of Nȃstase and Sissokho on the maximum sizes of partial spreads follows as a corollary. Furthermore, we get an improvement of the Johnson bound for constant dimension subspace codes.1 By [31, Th. 1], for ∆ = p e d with p the characteristic of the base field F q and p d, each full-length ∆divisible F q -linear code is the d-fold repetition of a p e -divisible F q -linear code.