Blog
Wild & Free Tools

How to Format SQL for a Word Document — Browser Workflow

Last updated: April 2026 6 min read

Table of Contents

  1. Why pasting raw SQL into Word looks bad
  2. The workflow
  3. Same workflow for Google Docs
  4. Same workflow for Apple Pages
  5. Why this matters for documentation
  6. Use cases
  7. Frequently Asked Questions

You need to put a SQL query into a Word document — a runbook, a project spec, a stakeholder report, a class assignment. The catch: pasting raw SQL into Word produces a wall of text that loses indentation when Word reflows it. Pasting from SSMS or DBeaver keeps the syntax highlighting but uses fonts that look wrong in a Word document.

The workflow that actually works: format the SQL in our browser tool, copy the formatted text, paste into Word as plain text, and apply a monospace font like Consolas or Courier New. The result is readable, properly indented SQL that survives Word's reflow.

Why Pasting Raw SQL Into Word Looks Bad

Word treats pasted text in one of three ways depending on the source:

None of these produce a clean, readable SQL block in a Word document. The right approach is plain-text paste plus a manual font change.

The Word Document SQL Formatting Workflow

  1. Format your query in the browser formatter — paste your SQL, pick the dialect, click Format.
  2. Click Copy in the formatter — the formatted SQL goes to your clipboard as plain text.
  3. Switch to your Word document.
  4. Paste as plain text — Cmd+Shift+V on Mac, Ctrl+Shift+V on Windows. Or use Word's Paste Special → Unformatted Text.
  5. Select the pasted SQL — click and drag to highlight the whole block.
  6. Change the font to monospace — Consolas (best on Windows), Courier New (works everywhere), or Cascadia Code (modern Windows).
  7. Reduce the font size — 9 or 10 point usually fits SQL nicely without wrapping.
  8. Optional: add a light grey background — Format → Borders and Shading → Shading tab → light grey. Mimics a code block.

The result is a readable, properly indented SQL block that survives in your Word document.

Same Workflow for Google Docs

Google Docs follows the same pattern with slightly different menu names:

  1. Format the SQL in the browser formatter and copy it.
  2. In Google Docs, paste with Cmd+Shift+V or Ctrl+Shift+V — this pastes as unformatted text.
  3. Select the pasted SQL.
  4. Change the font to a monospace font from the font dropdown — Roboto Mono is built into Google Docs.
  5. Reduce the size to 10 or 11 point.
  6. Optional: insert as a code block — Insert → Building blocks → Code block (rolled out to most accounts in 2023).

The Code block feature in Google Docs is the cleanest way to embed SQL — it auto-applies a monospace font and a grey background.

Sell Custom Apparel — We Handle Printing & Free Shipping

Same Workflow for Apple Pages

Apple Pages does not have a code block feature, so you need the manual approach:

  1. Format the SQL in the browser formatter and copy it.
  2. In Pages, paste with Edit → Paste and Match Style (Option+Shift+Cmd+V) — this pastes as unformatted text.
  3. Select the SQL.
  4. Change the font to Menlo or Courier New — both are pre-installed on macOS.
  5. Reduce size to 10 point.
  6. Apply a paragraph background color via the Format sidebar → Layout tab → Background.

Why This Matters for SQL in Documentation

Documentation that contains unreadable SQL gets ignored. Stakeholders skip past walls of text. Junior team members copy-paste blindly without understanding what they are running. Audits flag queries that nobody can verify.

Properly formatted SQL in documentation:

The 30 seconds it takes to format and paste the SQL pays back hours of confusion later.

Real Use Cases for SQL in Word Documents

Incident runbooks. "If alert X fires, run this query to check current state." Format the query so the on-call engineer can read it at 3am.

Project specifications. "The dashboard pulls data from this query." Stakeholders read the spec to understand what the dashboard shows.

Database design documents. "Here is how we calculate active users." The formula is a SQL query that needs to be readable by both engineers and product managers.

Compliance documentation. "Here is the query we run for the quarterly audit." The query needs to be readable by auditors who may not be SQL experts.

Class assignments. Students submitting SQL homework need readable formatting in their Word documents.

Job applications. Showcasing SQL skills in a portfolio attached to a resume.

Try It Free — No Signup Required

Runs 100% in your browser. No data is collected, stored, or sent anywhere.

Open Free SQL Formatter

Frequently Asked Questions

Why does my SQL look broken when I paste it into Word?

Word uses a proportional font (Calibri) by default. Proportional fonts have variable character widths, which destroys the alignment of indented SQL. Switch the pasted SQL to a monospace font like Consolas or Courier New and the indentation will look correct again.

Should I paste as rich text or plain text?

Plain text. Rich text from SSMS or DBeaver imports the source application styles, which clash with your document. Use Cmd+Shift+V (Mac) or Ctrl+Shift+V (Windows) to paste as plain text, then apply a monospace font manually.

What is the best monospace font for SQL in Word?

Consolas is the best choice on Windows — it ships with Office and is designed for code. Cascadia Code is a modern alternative on Windows 11. Courier New works everywhere as a fallback. On Mac, Menlo or SF Mono are good choices.

Can I just take a screenshot of the formatted SQL?

You can, but screenshots are not searchable, not copy-pasteable, and look bad when printed at different resolutions. Pasting as text with a monospace font is better in almost every way.

Does the browser formatter handle Microsoft Word automatically?

No — the formatter is a website that produces formatted text. The text needs to be pasted into Word manually. The formatter does not have a Word integration. If you format SQL for Word documents frequently, bookmark the browser tool and use it as a quick stop in your workflow.

Launch Your Own Clothing Brand — No Inventory, No Risk