Update: with grid 1.1 you can use /grid spawns to show possible mob spawn locations (always in red, only at night in yellow).
Grid 1.2 has a new command /grid circles which shows, well, circles to help you build round towers and similar stuff.
Grid 1.3 allows a second parameter to grid spawns to set the light level (for example, mushrooms need light level < 13, use /grid spawns 13 to show those blocks), has a keybinding to show/hide spawn blocks, and fixes the bug where large circles weren't centered on the player. Also, it brings the 1.1 and 1.2 features to forge (for 1.12.2). Sorry, forge 1.13.2 will take a while - as of now, it seems not to have functionality for configuration, and client-side-only commands, so I have to wait for them to complete their port.
Grid 1.3a fixes the bug that zero or negative coordinates crash the client.
Version 1.3b includes Portuguese translations, thanks to srbedrock.
Sometimes you want to place blocks in a regular pattern, so you need to count blocks, and if you mess up once, the error propagates to all subsequent blocks.
This mod displays a grid-like overlay over the world, with configurable spacing, so the blocks you're interested in get highlighted automatically.
For example, you're building a railroad and want to place a powered rail ever 20th block. Type /grid 20, walk to the first powered rail, type /grid here (or press the c button, can be configured), and the mod will highlight every 20th block from where you're standing.
Or, if you want to place torches in an area to prevent spawns, type /grid 5 - this highlights every 5th block; placing torches on each of them will light everything up enough.
You can switch between block mode (to highlight blocks to place stuff on) or line mode (to display borders; for example /grid chunks followed by grid lines will turn Grid into a chunk border highlighter), have the y-coordinate of the display floating with the player or fixed, and choose different X and Z spacings if you want that.
/grid show and /grid hide: show/hide the grid, bound to the B key.
/grid here: set the origin of the grid to where the player is standing. Bound to C (for center)
/grid blocks: set Block mode: show blue squares above marked blocks
/grid lines: set Line mode: show yellow lines to the N/W of marked blocks
/grid chunks: set X and Y spacing to 16 and the origin to chunk borders. Use together with /grid lines to get a chunk border display that's less intrusive than F3-G
/grid <n> <m>: <n> and <m> are numbers; set the grid spacing to n in X direction and m in Y direction
/grid <n>: set the grid spacing to n in both horizontal directions
/grid fixy: toggle between floating the y coordinate of the grid with the player, or fixing it to where the player stands when you use the command. Bound to the Y key.
/grid spawns: show possible mob spawn locations
/grid circles: shows circle overlays. In line mode, this shows regular circles; in block mode, it tries to find and mark the blocks you should build on to get a circle. Obviously, this can't work well with very small diameters, for example, trying to mark a 3x3 circle will give you a square.
/grid distance <n>: sets the range in blocks, that the grid is rendered around you. If you use very large spacings/circle diameters, you need to adjust this too. Be careful though, high values for distance absolutely kill your framerate when you turn spawn locations on.
All keys can be reconfigured using the standard Controls UI.