GraphQL Formatter
Format or minify GraphQL queries, mutations, fragments and schemas. Comments kept, clear indentation, and broken brackets or strings shown with line and column. No upload.
Format or minify GraphQL queries, mutations, fragments and schemas. Comments kept, clear indentation, and broken brackets or strings shown with line and column. No upload.
About this tool
GraphQL Formatter turns a GraphQL query that is squeezed onto one line, copied from a network log or written in a hurry into neat, indented text, and can also do the opposite. Paste a query, mutation, subscription, fragment or a schema with type, input, enum, interface, union and scalar definitions, or open a .graphql file. In Format mode every field goes on its own line, nested selections are indented by 2 or 4 spaces, arguments stay on the line of their field with commas between them, and each definition is separated by an empty line. Comments that start with # are kept on their own lines, descriptions in quotes or triple quotes stay above the field or type they describe, and fragment spreads (...Name) and inline fragments (... on Type) are laid out like fields. Minify mode does the opposite: it removes every space, comma and line break that is not needed, which gives the shortest text to send in a GET request or store in code; comments are left out there. The tool checks the form of the GraphQL as it goes. A bracket that is never closed or closed by the wrong kind, a string without its closing quote, or a character that GraphQL does not allow is reported with its line and column, with that line shown and an arrow under the spot. When everything is in order, it lists the operations, fragments and type definitions it found. It does not know your server’s schema, so whether a field exists is still checked by your GraphQL server. Formatting the result again gives the same text, so it is safe to use before a commit. Everything runs in your browser.

Query, mutation or schema.
Indent 2 or 4 spaces.
Line and column shown.
As a .graphql file.
Operations, fragments and types.
And descriptions stay in place.
The shortest text for requests.
Brackets and strings checked.
Formatting twice gives the same text.
Nothing leaves your browser.
Readable queries and schemas
Read a query copied from the network tab.
ExampleOne line to an indented tree.
Consistent .graphql files.
ExampleIndent 2 spaces.
Clean examples for an API guide.
ExampleComments kept.
Short queries in the URL.
ExampleMinify.
Types and enums laid out clearly.
ExampleOne field per line.
A missing bracket or quote.
ExampleLine 3, column 10.
Cleaner GraphQL
query GetUser is easier to find in logs than an anonymous query.
Pass $id instead of writing values into the query, so it can be cached and reused.
Put fields you ask for often in a fragment and spread it with ...Name.
GraphQL ignores commas; the formatter adds them only between arguments for reading.
Senior Software Engineer · Developer of Toolyconvert
Hemant developed GraphQL Formatter and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.
Last updated 29 November 2026
Featured on
Toolyconvert is listed on these product directories and launch platforms.