The 'blocksdesign' package constructs nested block and D-optimal factorial designs for any unstructured or factorial treatment model of any size. The nested block designs can have repeated nesting down to any required depth of nesting with either a simple set of nested blocks or a crossed row-and-column blocks design at each level of nesting. The block design at each level of nesting is optimized for D-efficiency within the blocks of each preceding set of blocks. The block sizes in any particular block classification are always as nearly equal as possible and never differ by more than a single plot. Outputs include a table showing the allocation of treatments to blocks, a plan layout showing the allocation of treatments within blocks (unstructured treatment designs only) the achieved D and A-efficiency factors for the block and treatment design (factorial treatment designs only) and, where feasible, an A-efficiency upper bound for the block design (unstructured treatment designs only).