⚙ GraphQL Formatter

Format, beautify, or minify GraphQL queries and mutations.

Last updated: November 8, 2026 · By the BoltQuickTools team

Make a one-line GraphQL query readable again

GraphQL queries often end up squashed onto one line in logs, network traces and string constants. This page is for developers who need to read one, or compact one for embedding. It reformats the text in the page with a small tokenizer, and the tool's code makes no network request.

Using the buttons

  1. Paste into Input. The Output pane updates in 2-space style with every edit.
  2. Press Beautify for 2 spaces, 4-Space for 4 spaces, or Minify to compact it.
  3. Press Copy Output. Editing the input again returns the output to 2-space style, so press Minify or 4-Space last.

Before and after

The page loads with this query:

query GetUser($id:ID!,$includeOrders:Boolean=false){user(id:$id){id name email orders @include(if:$includeOrders){id total items{name price quantity}}}}

Beautify gives:

query GetUser($id: ID!, $includeOrders: Boolean=false) {
  user(id: $id) {
    id name email orders @include(if: $includeOrders) {
      id total items {
        name price quantity
      }
    }
  }
}

Minify gives:

query GetUser($id: ID!, $includeOrders: Boolean=false) {user(id: $id) {id name email orders @include(if: $includeOrders) {id total items {name price quantity}}}}

Line breaks follow braces and commas, so fields separated only by spaces stay together on one line. Put commas between fields if you want one per line. { a, b, c } beautifies with each field on its own line, though the commas stay in the output. Minify is not the smallest possible form either: it keeps a space after each colon and before each opening brace.

Input that does not survive

When the output looks wrong

Does it check that my query is valid?

Only that curly braces balance. Anything else passes: qurey X ( { a } beautified with a success message, even with a misspelled keyword and an unclosed parenthesis. It never sees your schema.

Why did the output disappear?

Unbalanced braces clear the output and show Parse error: unbalanced braces in the status line, with the depth when a brace is left open. That is normal while you are halfway through typing a block. Braces inside double-quoted strings are not counted.

Where do I test the formatted query?

Send it to your endpoint with the API tester, or turn a captured request into code with curl to code. The variables object is plain JSON, which the JSON formatter handles.