Format a minified query
Input: query{user(id:"1"){name email posts{title body}}}
Output: query {\n user(id: "1") {\n name\n email\n posts {\n title\n body\n }\n }\n}
500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.
Format and minify GraphQL queries, mutations, and SDL schemas in your browser. No external library needed.
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.
Input: query{user(id:"1"){name email posts{title body}}}
Output: query {\n user(id: "1") {\n name\n email\n posts {\n title\n body\n }\n }\n}
Input: query GetUser($id: ID!) {\n user(id: $id) {\n name\n }\n}
Output: query GetUser($id:ID!){user(id:$id){name}}
Input: type User{\"\"\"User identifier\"\"\" id: ID!\nname:String!}
Output: type User {\n """User identifier"""\n id: ID!\n name: String!\n}
Input: mutation{createUser(input:{name:"A",email:"a@b.c"}){id name}}
Output: mutation {\n createUser(input: { name: "A", email: "a@b.c" }) {\n id\n name\n }\n}