Like my post on DIN 931 / ISO 4014, At a point when your working with 3D printers you will need to use machine screws, bolts and other fixings. The M series of fixings is produced to the dimensions in ISO 4017 (replaces DIN 933).
ISO 4017 specifies the characteristics, tolerances and variation in form of metric-sized hex head screws, and covers thread diameters from M1.6 up to and including M160.
Most of the time when doing anything with a 3D printer, you are unlikely to need sizes outside M2 to M10, While generally called bolts, technically a bolt is a fixing with a partially threaded shank, fully threaded screws are called machine screws, or just screws.
ISO 4017 Hexagonal head screw dimensions

M2 | M2.5 | M3 | M4 | M5 | M6 | M8 | M10 | ||||
---|---|---|---|---|---|---|---|---|---|---|---|
Pitch | 0.4 | 0.45 | 0.5 | 0.7 | 0.8 | 1 | 1.25 | 1.5 | |||
ab | max | 1.2 | 1.35 | 1.5 | 2.1 | 2.4 | 3 | 3.75 | 4.5 | ||
min | 0.4 | 0.45 | 0.5 | 0.7 | 0.8 | 1 | 1.25 | 1.5 | |||
c | max | 0.25 | 0.25 | 0.4 | 0.4 | 0.5 | 0.5 | 0.6 | 0.6 | ||
min | 0.1 | 0.1 | 0.15 | 0.15 | 0.15 | 0.15 | 0.15 | 0.15 | |||
da | max | 2.6 | 3.1 | 3.6 | 4.7 | 5.7 | 6.8 | 9.2 | 11.2 | ||
dw | min | 3.34 | 4.34 | 4.85 | 6.2 | 7.2 | 8.88 | 11.63 | 14.63 | ||
e | min | 4.32 | 5.45 | 6.01 | 7.66 | 8.79 | 11.05 | 14.38 | 17.77 | ||
k | nom | 1.4 | 1.7 | 2 | 2.8 | 3.5 | 4 | 5.3 | 6.4 | ||
min | 1.525 | 1.825 | 2.125 | 2.925 | 3.65 | 4.15 | 5.45 | 6.58 | |||
max | 1.275 | 1.575 | 1.875 | 2.675 | 3.35 | 3.85 | 5.15 | 6.22 | |||
kw | min | 0.89 | 1.1 | 1.31 | 1.87 | 2.35 | 2.7 | 3.61 | 4.35 | ||
r | min | 0.1 | 0.1 | 0.1 | 0.2 | 0,2 | 0.25 | 0.4 | 0.4 | ||
s | nom = max | 4 | 5 | 5.5 | 7 | 8 | 10 | 13 | 16 | ||
min | 3.82 | 4.82 | 5.32 | 6.78 | 7.78 | 9.78 | 12.73 | 15.73 |
The table above contains some extra information that is not shown in the first image; this concerns smaller features relating to the underhead fillet.

DIN 993 Hexagonal head bolt preferred lengths.

l | Range of standard lengths | |||||||
---|---|---|---|---|---|---|---|---|
M2 | M2.5 | M3 | M4 | M5 | M6 | M8 | M10 | |
4 | ✓ | |||||||
5 | ✓ | ✓ | ||||||
6 | ✓ | ✓ | ✓ | |||||
8 | ✓ | ✓ | ✓ | ✓ | ||||
10 | ✓ | ✓ | ✓ | ✓ | ✓ | |||
12 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
16 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
20 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
25 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
30 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
35 | ✓ | ✓ | ✓ | ✓ | ✓ | |||
40 | ✓ | ✓ | ✓ | ✓ | ✓ | |||
45 | ✓ | ✓ | ✓ | ✓ | ||||
50 | ✓ | ✓ | ✓ | ✓ | ||||
55 | ✓ | ✓ | ✓ | |||||
60 | ✓ | ✓ | ✓ | |||||
65 | ✓ | ✓ | ||||||
70 | ✓ | ✓ | ||||||
80 | ✓ | ✓ | ||||||
90 | ✓ | |||||||
100 | ✓ |