GraphQL Formatter Online

Beautify or minify GraphQL queries and schemas instantly in your browser.

Indent:
INPUT0 chars
OUTPUT

What Is GraphQL Formatter?

GraphQL Formatter is a free online tool that cleans up and restructures GraphQL queries, mutations, and schema definitions. In Beautify mode it applies consistent indentation and line breaks so your GraphQL code is easy to read and maintain. In Minify mode it removes whitespace and comments to produce a more compact representation.

How to Use GraphQL Formatter

  1. Choose Beautify to format with indentation, or Minify to compress.
  2. Paste your GraphQL query, mutation, or schema into the input panel, or click Load Sample to try an example.
  3. The formatted output appears instantly in the right panel.
  4. Click Copy to copy the result to clipboard.

Features

  • Beautify mode with 2-space or 4-space indentation
  • Minify mode removes whitespace and comments
  • Supports queries, mutations, subscriptions, and fragments
  • Handles directives (@include, @skip, @deprecated, etc.)
  • Formats type definitions and schema declarations
  • Uses official GraphQL.js parser for accurate formatting
  • Copy result to clipboard
  • Runs entirely in your browser — zero data uploaded

FAQ

What is GraphQL Formatter?

GraphQL Formatter is a free online tool that formats GraphQL queries, mutations, and schema definitions. It can beautify GraphQL with consistent indentation for readability, or minify it by removing whitespace and comments.

Does this support GraphQL fragments and directives?

Yes. This formatter supports all GraphQL syntax including queries, mutations, subscriptions, fragments, directives, type definitions, and schema declarations.

Is my GraphQL code uploaded to a server?

No. All formatting happens entirely in your browser using the official GraphQL.js parser. Your code never leaves your device.