GraphQL Formatter

Beautify GraphQL queries with consistent indentation. Paste a query and click Run.

  • Runs entirely in your browser
  • No data stored or sent to a server
  • Free forever — no signup
  • Instant conversion

Input and Output

Use the interactive encoder and decoder on this page to process your text.

Learn more about JSON formatting

How to Format GraphQL Queries

GraphQL Formatting

When to Format GraphQL

Beautify minified GraphQL queries from network tabs, normalize pasted schema snippets, or prepare operations for documentation and code review. Consistent indentation makes nested selections, fragments, and variable definitions easier to read during API debugging.

What Gets Formatted

Queries, mutations, subscriptions, and schema definition language (SDL) fragments are supported. The formatter adds line breaks and indentation around fields, arguments, directives, and inline fragments without changing query semantics.

Developer Tips

  • Format before sharing GraphQL operations in tickets or API docs
  • Fix syntax errors before formatting — invalid GraphQL may not beautify cleanly
  • Pair with your GraphQL client to verify formatted queries still execute correctly

Frequently asked questions

Does formatting change query results?

No. Whitespace in GraphQL documents is not significant. Only readability changes.

Are GraphQL variables and fragments preserved?

Yes. Variable definitions, named fragments, and directives are kept intact during formatting.