Format a minified query
query{user(id:"1"){name email posts{title body}}}query {\n user(id: "1") {\n name\n email\n posts {\n title\n body\n }\n }\n}Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.
Format and minify GraphQL queries, mutations, and SDL schemas in your browser. No external library needed.
Loading interactive tool…
The GraphQL Formatter processes GraphQL query language documents and SDL (Schema Definition Language) with a lightweight pure-JavaScript parser that handles indentation based on brace depth, normalizes whitespace, and preserves string literals and comments. The Minify mode removes all whitespace, newlines, and comments to produce a compact single-line query suitable for HTTP GET requests or logging. No heavy GraphQL.js library is needed — the formatter is built from scratch at well under 1KB of logic.
No GraphQL.js dependency — the formatter is pure JS under 1KB so the page loads instantly
Handles queries, mutations, subscriptions, fragments, and SDL in the same tool
Minify mode is useful for pasting queries into URL parameters or logging
Instant client-side processing with no server round-trip
query{user(id:"1"){name email posts{title body}}}query {\n user(id: "1") {\n name\n email\n posts {\n title\n body\n }\n }\n}query GetUser($id: ID!) {\n user(id: $id) {\n name\n }\n}query GetUser($id:ID!){user(id:$id){name}}type User{\"\"\"User identifier\"\"\" id: ID!\nname:String!}type User {\n """User identifier"""\n id: ID!\n name: String!\n}mutation{createUser(input:{name:"A",email:"a@b.c"}){id name}}mutation {\n createUser(input: { name: "A", email: "a@b.c" }) {\n id\n name\n }\n}