GraphQL Formatter
Indent queries, mutations and fragments with one field per line and tidy arguments.
Your GraphQL
Lines: — · Tokens: —
How to use the GraphQL Formatter
- Paste the GraphQL document you want to tidy.
- Choose an indent width, or click Minify for the most compact form.
- Copy the result with the Copy button.
Features
- One field per line inside every selection set
- Operations and fragments indented correctly
- Arguments and directives kept with their field
- One-click minify mode
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