GraphQL Formatter

Indent queries, mutations and fragments with one field per line and tidy arguments.

Your GraphQL

Lines: — · Tokens: —
Long argument lists are wrapped one argument per line, and arguments stay next to their field.

How to use the GraphQL Formatter

  1. Paste the GraphQL document you want to tidy.
  2. Choose an indent width, or click Minify for the most compact form.
  3. Copy the result with the Copy button.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online graphql formatter.

It parses the document into tokens and reprints it so each field, argument and directive sits on a readable indented line.
Queries, mutations, subscriptions and fragments, including inline fragments, fragment spreads and nested selection sets.
Short argument lists stay on the field line, while a list longer than sixty characters is wrapped with one argument per line.
No. The formatter works on syntax only, so it will not tell you whether a field exists in your schema.
It removes optional whitespace, commas and newlines to produce the shortest possible equivalent document.
Yes. Hash comments are kept and printed on their own line so they stay attached to the right part of the document.
No. Tokenising and printing happen entirely in your browser, so your document stays private.
Yes, the GraphQL formatter is completely free with no account needed.

Last updated: October 10, 2026