GraphQL Formatter
Formats queries and SDL, validates a document against a schema and prints the type it resolves to.
Reprints a GraphQL document in the conventional style — one field per line, arguments spaced, indentation by selection depth. It parses the full October 2021 grammar, so a schema file with directives, interfaces and unions goes through as readily as a query.
GraphQL in
Formatted
Token stream
identical to the input
How to use it
Paste the document or open a file
A query, a mutation, a fragment, or a whole `.graphql` schema. Anonymous and named operations are both fine.
Check the token stream line
After every run the formatter re-tokenises its own output and compares it to the input. The stat says "identical to the input" when nothing but layout moved — and shouts if it did not.
Copy or download the result
The download is a `.graphql` file with the right MIME type, ready to drop into a schema directory.
Common questions
Where did my commas go?
GraphQL treats commas as ignored tokens — they are whitespace with a shape. The formatter normalises them away because the conventional style has none, and no meaning is lost by removing them.
Are comments kept?
Yes, and the comparison after each run checks that too — the comment tokens in the output have to match the ones that went in. A formatter that drops the `# deprecated` line above a field has broken the document as far as the next reader is concerned.
Does it validate the query against a schema?
No. It checks the grammar, not the meaning — a query asking for a field that does not exist is syntactically perfect and formats fine. Validation needs the schema, which this page never has.
Feed it from
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
YAML Formatter & Validator
Re-indents YAML consistently, validates it, and flags the tab and anchor mistakes that break parsers.
TOML Formatter & Validator
Formats and validates TOML, normalising table ordering and inline-table style.
XML Formatter & Validator
Indents XML and reports the line and column of the first well-formedness fault.
Next
These accept what this tool produces, so the result can go straight in.
HTTP Request Builder
Composes and sends a GET/POST/PUT/PATCH/DELETE/HEAD request with custom headers and a body, and shows the status, headers, body and timing — without ever forwarding cookies or Authorization.
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
OpenAPI Linter
Checks an OpenAPI document for missing responses, unused schemas, references that point at nothing and the other faults that break code generators.
Base64 Encoder & Decoder
Encodes and decodes Base64 and Base64URL for text or files, handling UTF-8 correctly.
curl to Code
Converts a curl command into fetch, axios, Python requests, Go, PHP or PowerShell.
Text Hash
Computes MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC-32 of a string, with an uppercase and Base64 output option.