Skip to content
Free Tool Arena

Developer Utilities · Free tool

GraphQL Formatter

Pretty-print or minify any GraphQL query, mutation, or fragment in your browser. Instantly format your code with this free, no-download tool that requires no sign-up.

Updated June 2026
Formatted · 547 chars (179% of source)
queryGetUser($id: ID!, $includePosts: Boolean=false) {
  user(
  id: 
  $
  id) {
    id
    name
    email
    createdAt
    avatar {
      small
      medium
      large
    }
    ...
    UserStats
    @
    include(
    if: 
    $
    includePosts) {
      postCount
      followerCount
    }
    posts(
    first: 
    10, 
    orderBy: 
    CREATED_DESC) {
      edges {
        node {
          id
          title
          publishedAt
        }
      }
    }
  }
}
fragmentUserStatsonUser {
  stats {
    posts
    comments
    likes
  }
}

Hand-written tokenizer — no graphql package dependency, ~150 lines, kept small. Handles queries, mutations, subscriptions, fragments, inline fragments, directives, variables, block strings, comments.

Found this useful?EmailBuy Me a Coffee

Advertisement

What it does

GraphQL query formatter — pretty-print or minify operations. Handles queries, mutations, subscriptions, fragments, inline-fragments, directives, variables, block strings, comments.

Hand-written tokenizer (no graphql package) so the tool stays small. Toggle between pretty and minified; shows compression ratio after minify.

Embed this tool on your siteShow snippet

Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.

<iframe src="https://freetoolarena.com/embed/graphql-formatter" width="100%" height="720" frameborder="0" loading="lazy" title="GraphQL Formatter" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>
Embed docs →

How to use it

  1. Paste your GraphQL operation.
  2. Toggle pretty vs minify.
  3. Use 'Use as input' to round-trip through the formatter again.

Advertisement

Learn more

Explore more developer utilities tools

100% in-browserNo downloadsNo sign-upMalware-freeHow we keep this safe →

Found this useful?

The tools stay free thanks to readers who chip in or spread the word.

Buy Me a Coffee