GraphQL Formatter

Beautify a minified GraphQL query, mutation, or schema definition

Input GraphQL

Formatted GraphQL

Nothing you paste here is ever uploaded — formatting happens entirely in your browser.

About this tool

GraphQL queries and schema definitions use curly braces to nest fields and types, which makes them just as hard to read when compressed onto one line as minified CSS or JSON. This formatter walks through the input and places each field, brace, and statement on its own line, indenting nested selection sets two spaces deeper for every level of brace depth. It's a lightweight, brace-driven beautifier rather than a full GraphQL parser, so it works well on typical queries and schema definitions without needing a GraphQL grammar behind it.

Does this validate that my GraphQL is correct?

No — it reformats based on braces and statement boundaries, not a GraphQL schema, so it won't catch an unknown field or a type mismatch. Use your GraphQL client or server's validation for that.

Does it work on mutations and schema definitions too, or only queries?

Since it formats based on braces rather than the "query" keyword specifically, it works the same way on mutations, subscriptions, fragments, and type/schema definition language (SDL) files.

What happens to arguments and variables inside parentheses?

Arguments in parentheses, like (id: 1), stay on the same line as the field they belong to since indentation is driven by curly braces rather than parentheses — only the field's nested selection set gets its own indented block.