JSON & YAML Tools

GraphQL Formatter & Minifier

Format, beautify, validate, or minify GraphQL queries and schemas instantly using standard indentation.

Input GraphQL Query
Result
 

What is this tool?

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. While query structures can grow deeply nested and hard to read, proper formatting (with indentation, fields alignment, and clean brackets) helps developers debug queries and mutations quickly.

How to use it

1. Paste your disorganized or minified GraphQL query in the Input editor.

2. Choose your preferred indentation level (2 spaces, 4 spaces, or tabs).

3. Click "Beautify" to format the query, or "Minify" to compact it.

4. Click "Copy" to save the output.

Pro tips

  • Minified queries are ideal for embedding directly in code strings or config files.
  • Comments (lines starting with #) are preserved during formatting but stripped out entirely during minification.

Frequently asked questions

Is my GraphQL query private?

Yes. All formatting and minification are executed 100% client-side in your browser using JavaScript. No queries or schemas are sent to our servers.

Does this formatter validate syntax?

It tokenizes and structures your query. If you have unclosed brackets or brace mismatches, the formatter helps align them, making visual debugging much easier.

What is the benefit of GraphQL minification?

Minifying GraphQL queries strips comments and collapsing whitespace. This reduces the size of your HTTP POST payload, saving bandwidth when queries are sent to your GraphQL API server.