GraphQL Formatter & Minifier

Beautify GraphQL queries/schemas with Prettier, or minify. This tool beautifies and minifies GraphQL on one page — paste your code, pick a mode, and click. Everything runs on your device, nothing is sent to a server.

The result will appear here…
or press Ctrl+Enter

Everything runs in your browser. Your code is never sent to our servers.

728 × 90Ad Space AvailablePlace your ad here

Example

Example Input

query{user{id name}}

Example Output

query {
  user {
    id
    name
  }
}

How to Use

  1. 1Choose Format or Minify mode at the top.
  2. 2Paste your GraphQL code into the Input field.
  3. 3If needed, set the indent width in "More settings".
  4. 4Click the button (or press Ctrl+Enter) to process. The result appears in the Output field.
  5. 5Click Copy to copy the result.

About the GraphQL Formatter

The GraphQL Formatter beautifies GraphQL queries, mutations, and schemas using Prettier so fields and blocks are consistently indented.

How it works: Format runs Prettier's GraphQL parser to lay out field selections, arguments, and type definitions. Minify tightens whitespace for transmission.

GraphQL powers modern APIs; clean queries and schemas are easier to read and collaborate on, especially for complex nested queries.

FAQ

Can this GraphQL tool both format and minify?

Yes. One page with a toggle — Format mode prettifies (beautifies) with indentation, and Minify mode compacts it. No need for two separate pages.

Is my code sent to a server?

No. GraphQL is processed entirely in your browser using JavaScript/WebAssembly. Your code never leaves your device.

Related Tools

Related Categories