Format, minify and validate GraphQL queries and schemas, with errors by line and column
Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 22 Oct 2026.Paste a GraphQL query, mutation or schema and get it back formatted with 2 or 4 spaces or tabs, or minified, by the same parser GraphQL servers use. Syntax errors show their line and column, and the query is checked for unused variables, unknown fragments and, with your schema, unknown fields.
Paste a query, mutation, fragment or schema into the GraphQL pane, or click Try an example.
Choose Format or Minify, and 2 spaces, 4 spaces or a tab for the indent.
Fix any error shown with its line and column, and read the checks for unused variables or unknown fragments.
Turn on Check against a schema and paste your SDL to check fields and arguments, then click Copy.
Queries copied from logs, network tabs or code are often on one line or indented by hand. Paste one here and it is formatted as you type, one field per line, with the indent you choose. The parser and printer are graphql-js, the reference implementation that most JavaScript GraphQL servers run, so a document that parses here is one your server will parse too.
Errors with a position. A syntax error shows the message of the parser, the line and column where it stopped and a plain hint: a missing closing brace, single quotes instead of double quotes, a colon missing after an argument name, or empty braces.
Checks without a schema. An operation is checked with the rules of the specification that need no schema: a variable used but not declared, a variable declared but never used, an unknown or unused fragment, fragments that spread each other in a loop, two operations with the same name, an anonymous operation next to others, and repeated arguments or input fields.
Checks with your schema. Turn on Check against a schema and paste your SDL, and every rule of section 5 runs: unknown fields with suggestions, arguments of the wrong type, missing sub-selections, fragments on the wrong type. A schema file on its own is checked too: unknown types, duplicate names, interfaces not fully implemented.
Comments. The graphql-js printer drops comments. Comments above a definition and at the end of the file are put back where they were; a comment inside a definition is counted and reported, so nothing is lost without you knowing. Minify removes every comment and all optional whitespace and commas, which is what you want for a GET request or a persisted query.
Everything runs in your browser and nothing you paste is sent. Related tools: JSON Formatter, SQL Formatter, JSON to TypeScript.
Paste the query into the GraphQL pane and the formatted version appears next to it as you type. Pick 2 spaces, 4 spaces or a tab, then press Copy or Ctrl+Enter. Schemas in SDL, mutations, subscriptions and fragments are formatted the same way.
Yes. Turn on Check against a schema and paste your schema in SDL. The query is then checked with every validation rule of the GraphQL specification, and each problem, such as an unknown field or an argument of the wrong type, is listed with its line and column.
The graphql-js printer, which most GraphQL servers in JavaScript use, does not keep comments. Comments above each definition and at the end are put back here; one inside a definition cannot be placed, so the page tells you how many were left out.
No. Parsing, formatting and validation all run in your browser with the graphql-js library, so the query, its variables and your schema never leave your device. Internal schemas and queries with real IDs are safe to paste.
Minify removes every character GraphQL ignores: spaces, line breaks, commas and comments. The query means exactly the same, and the shorter text suits a GET request URL, a persisted query store or a test fixture. Strings and block strings are kept as written.
Syntax errors, variables used but not declared, variables declared but never used, unknown or unused fragments, fragment cycles, duplicate operation, variable, argument and input field names, and an anonymous operation next to other operations. Field names and types need the schema to be checked.
Rates and rules change; check the source before you rely on a figure.
Still stuck? Ask about GraphQL Formatter and anybody who knows can answer. No account needed.
Same job, other tools: JavaScript Beautifier – Reformat JavaScript with Prettier, in the indent style you use · JSON Minifier – Strip whitespace from JSON for production · JSON Validator – Check JSON and see exactly where it breaks · HTML Minifier – Strip comments and spare whitespace from HTML and see the saving · CSS Minifier – Compress a stylesheet and see exactly how many bytes you saved.
On the related tools: Markdown to HTML – Convert Markdown into clean, safe HTML you can paste anywhere.