About GraphQL Formatter — Queries & Schema (SDL)
GraphQL documents drift quickly: queries get pasted from logs as one long line, schema files mix tabs and spaces, and nested selection sets lose their shape after a few edits. This free GraphQL formatter rewrites any query, mutation, subscription, or schema definition (SDL) into a single canonical layout — consistent indentation, aligned arguments, and one field per line.
It runs entirely in your browser. Paste a compact `{user{id name}}`, a deeply nested operation, or a full `type` and `schema` definition, and get back clean, readable GraphQL. Fragments and directives are preserved exactly as written.
Nothing you paste is ever uploaded — your queries and schemas never leave your device, which matters when they describe internal APIs.
Features
- Formats queries, mutations, subscriptions, and SDL/schema definitions
- Canonical indentation and one-field-per-line layout via Prettier
- Clear syntax errors instead of silent failures
- Fully offline — your GraphQL never leaves the browser
How to use
- Paste a GraphQL query, mutation, or schema into the input pane.
- Click Format to apply canonical indentation and field layout.
- Copy the formatted result from the output pane — or clear and start again.
Frequently asked questions
Does this format GraphQL schemas (SDL) as well as queries?
Yes. The formatter handles both executable documents (queries, mutations, subscriptions, fragments) and schema definition language — type, interface, enum, input, and schema definitions are all reformatted with consistent spacing and indentation.
Are my fragments and directives preserved?
Yes. Formatting only changes whitespace and layout. Fragment definitions, fragment spreads, directives, and arguments are all kept intact — just laid out canonically.
What happens if my GraphQL has a syntax error?
The formatter parses your input first, so invalid GraphQL is not silently rewritten. Instead you get a clear error message describing the problem, and the output pane stays empty until the input parses.
Is my data sent to a server?
No. All parsing and formatting happen locally in your browser. Your queries and schemas — including anything describing internal or private APIs — never leave your device.
Related tools
Everything runs locally in your browser — your input is never uploaded.