Focused ion beam (FIB) milling is receiving increasing attention for nanostructuring in silicon (Si). These structures can for example be used for photonic crystal structures in a silicon-on-insulator (SOI) configuration or for moulds which can have various applications in combination with imprint technologies. However, FIB fabrication of submicrometre holes having perfectly vertical sidewalls is still challenging due to the redeposition effect in Si. In this study we show how the scan routine of the ion beam can be used as a sidewall optimization parameter. The experiments have been performed in Si and SOI. Furthermore, we show that sidewall angles as small as 1.5◦ are possible in Si membranes using a spiral scan method. We investigate the effect of the dose, loop number and dwell time on the sidewall angle,interhole milling and total milling depth by studying the milling of single and multiple holes into a crystal. We show that the sidewall angles can be as small as 5◦ in (bulk) Si and SOI when applying a larger dose. Finally, we found that a relatively large dwell time of 1 ms and a small loop number is favourable for obtaining vertical sidewalls. By comparing the results with those obtained by others, we conclude that the number of loops at a fixed dose per hole is the parameter that determines the sidewall angle and not the dwell time by itself.