How to Center Text in Minecraft Chat, MOTD & Books

Centering text in Minecraft is tricky because the game uses a proportional font where characters have different widths. Our tool on text.9minecraft.net calculates the exact game pixel length of your text and pads it with the right number of spaces for chat, MOTDs, books, and signs.

Text Width & Center Calculator

Why Counting Characters Fails in Minecraft

If you try to center a line in Minecraft by counting letters and adding an equal number of spaces, your text will usually look off-center. This happens because Minecraft does not use a monospaced font. Instead, each character (glyph) takes up a specific number of game pixels.

To align text properly, you must measure the total pixel width of the line rather than the character count. Here is how Minecraft measures standard characters:

Because a word like ill! takes up far fewer pixels than WWWW, accurate centering requires calculating the exact pixel total of your text, subtracting it from the container width, and filling the left side with 4-pixel space characters.

Minecraft Text Width Targets Explained

Different user interface elements in Minecraft have different maximum pixel widths. Before you pad your text with spaces, you need to know the target width of the container where the text will appear:

Step-by-Step: Using the Text Centering Tool

Instead of doing pixel math by hand for every letter, you can use the centering tool on text.9minecraft.net to generate ready-to-paste lines padded with spaces.

  1. Select your target: Choose Chat (320 pixels), MOTD (about 270 pixels), Book Page (114 pixels), Sign Line (90 pixels), or enter a custom pixel width.
  2. Enter your text: Type or paste the lines you want to center. If you plan to use bold text in-game, include your formatting codes so the tool accounts for the extra 1 pixel per bold character.
  3. Copy the padded output: The tool measures your line using real glyph widths and outputs the text with the exact number of leading 4-pixel spaces required to push your text to the middle.
  4. Paste into Minecraft: Paste the result directly into your command block, chat bar, server configuration file, book, or sign.

How to Center Text in Minecraft Chat

Centering announcements in chat makes server broadcasts, minigame summaries, and welcome messages look clean and organized. The default chat box is 320 pixels wide.

When centering a phrase like WELCOME TO THE SERVER, the tool counts 6 pixels for each standard letter and 4 pixels for each space between words. It then subtracts that total from the 320-pixel chat width and adds enough 4-pixel spaces in front to place the text right in the middle.

Here is a copyable example padded for the 320-pixel default chat width:

                         WELCOME TO THE SERVER

If you make the same text bold using §l, each bolded letter gains 1 pixel in width. You must use fewer leading spaces to keep the wider text centered:

                       §lWELCOME TO THE SERVER

How to Center a Server MOTD

Your server MOTD appears on the multiplayer screen and has a width of about 270 pixels per line. Centering both lines independently ensures that a short second line sits directly underneath a longer first line.

To apply a centered MOTD in your server.properties file, generate each line using the 270-pixel MOTD target and join them with the newline code \n.

Copyable 270-pixel MOTD example:

motd=                   §lMY MINECRAFT SERVER\n                      Survival - Creative - PvP

Notice how the second line requires more leading spaces even though it has more characters. That is because thin characters like i (2 pixels) and normal letters (6 pixels) take up less space than the bold letters on the first line (which get an extra 1 pixel per character).

Centering Text in Books and Signs

Books and signs have much narrower containers, making accurate pixel measurement even more noticeable.

Book Pages (114 pixels): When writing rules, guides, or chapter titles in a Book and Quill, select the 114-pixel target. Because a book page is narrow compared to the 320-pixel chat box, keep your centered headings brief so they do not wrap onto the next line.

Copyable book heading example (114-pixel target):

      SERVER RULES
       Read First!

Sign Lines (90 pixels): A sign line is 90 pixels wide. While Minecraft centers sign text on its own, using the 90-pixel target is helpful when testing if your text and spaces will fit on a single sign line without overflowing, or when formatting sign-sized layouts for custom displays.

Questions

Why does bold text shift my centered line to the right?

In Minecraft, bold formatting adds 1 extra pixel to the width of every character. If you pad a line for normal text and then make it bold afterward, the line becomes wider and shifts off-center. Always include bold formatting when measuring pixel width.

Why doesn't my centered chat look centered to every player?

Chat centering targets the default chat width of 320 pixels. If a player has changed their chat width setting in their client options or uses a custom font resource pack, the space padding will not match their modified screen setup.

How many pixels wide is a space in Minecraft?

A single space character in Minecraft is 4 game pixels wide, while most standard letters are 6 pixels wide (including the 1-pixel gap between characters) and thin characters like i and ! are 2 pixels wide.

Can I center multiple lines of text so they align with each other?

Yes. Measure and pad each line separately using the same pixel target (such as 320 pixels for chat, about 270 for an MOTD, 114 for a book page, or 90 for a sign line). The tool calculates the leading 4-pixel spaces for each line individually so their midpoints line up.

Related guides

See all →