millimeter


\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{eso-pic}

\AddToShipoutPictureBG{%add * to use it only in a single page, change BG to FG for foreground grid
\begin{tikzpicture}[remember picture, overlay,
                    fine div/.append style={line width=0.05pt,
                                              color=blue!10},
                    coarse div/.style={line width=0.1pt,
                                            color=blue!20} ]
    \pgfmathsetmacro{\margin}{5} %global margin in mm. Set it to 0 to cover the whole page
    \draw[fine div] 
        (current page.south west) 
            grid[step=1mm, xshift=\margin mm, yshift=\margin mm]
        ([xshift=-2*\margin mm, yshift=-2*\margin mm] current page.north east);
        
    \draw[coarse div] 
        (current page.south west) 
            grid[step=5mm, xshift=\margin mm, yshift=\margin mm]
        ([xshift=-2*\margin mm, yshift=-2*\margin mm] current page.north east);
\end{tikzpicture}%
}

\begin{document}
\shipout\null %empty page
\end{document}