Postman JSON to cURL

Takes a single Postman request-item JSON, the kind you get by copying one request out of a collection, and generates the equivalent curl command: -X for the method, one -H per enabled header, and --data for a raw or urlencoded body, with every value shell-quoted. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

Postman is great for building and saving requests, but sometimes you just need the plain curl command for a README, a bug report, or a quick terminal test, and copying every header and body field by hand from the request editor is tedious and error-prone.

This tool takes the request-item JSON Postman itself uses internally (the same shape you get from "Copy as JSON" on a single request) and generates the equivalent curl command entirely in your browser.

What Is Postman JSON to cURL?

A focused converter that reads a single Postman request's method, URL, headers, and body, and re-emits them as a properly shell-quoted curl command.

It's part of this site's API Tools collection and runs entirely client-side; nothing you paste in is sent anywhere.

How Postman JSON to cURL Works

The JSON is parsed and checked for a request field (the collection-item shape) before falling back to treating the whole object as the request; from there, method, url, header, and body are each read using the same field names Postman's own schema defines.

The URL is taken from url.raw when present, or reconstructed from protocol/host/path/query otherwise; enabled headers become -H flags; a raw or urlencoded body becomes a --data flag; every value is wrapped in single quotes with embedded quotes escaped, so the result is safe to paste into a shell as-is.

When To Use Postman JSON to cURL

Use it when you need to hand someone a runnable curl command for a request you already have saved in Postman, without manually re-typing headers and body.

It's also useful for turning a single request into a portable, tool-independent form for documentation, bug reports, or CI scripts that shouldn't depend on Postman being installed.

Features

Advantages

  • Accepts both the full collection-item shape and a bare request object, so you don't need to strip out the wrapper first.
  • Shell-quotes every value (URL, header, body) consistently, avoiding the broken commands that come from pasting raw values with spaces or quotes into a terminal by hand.
  • Handles both string and object forms of Postman's url field, including reconstructing a URL from its parts when there's no raw string.

Limitations

  • Only "raw" and "urlencoded" body modes are converted; formdata (multipart) and file-upload bodies aren't supported since they don't reduce to a single --data flag.
  • Postman auth blocks (bearer, basic, OAuth2, etc.) configured separately from the header array aren't read; add an explicit Authorization header in the source JSON if you need one in the output.
  • {{variable}} placeholders in the URL or header values are carried over literally, the same way Postman leaves them unresolved outside of an environment.

Examples

Converting a POST request with headers and a JSON body

Input

{
  "request": {
    "method": "POST",
    "url": "https://api.example.com/users",
    "header": [{ "key": "Content-Type", "value": "application/json" }],
    "body": { "mode": "raw", "raw": "{\"name\":\"Ada\"}" }
  }
}

Output

curl -X POST 'https://api.example.com/users' \
  -H 'Content-Type: application/json' \
  --data '{"name":"Ada"}'

Method, URL, header, and raw JSON body are each carried straight over into their curl equivalents, with the body value single-quoted.

Best Practices & Notes

Best Practices

  • Export or copy the request-item JSON directly from Postman rather than hand-typing it, so field names and nesting match what this tool expects.
  • Review generated commands for any {{variable}} placeholders before running them, and substitute in real values or use your shell's own environment variables.
  • If a request uses Postman's auth tab instead of a raw Authorization header, add that header explicitly to the JSON before converting.

Developer Notes

URL and header/body values are always wrapped in single quotes with embedded single quotes escaped via the standard '\'' POSIX sequence, rather than trying to detect which values are "safe" to leave unquoted; this keeps the output predictable and correct across all shells that curl commands are typically run in.

Postman JSON to cURL Use Cases

  • Turning a saved Postman request into a curl command for a README or API documentation page
  • Attaching a reproducible curl command to a bug report instead of a screenshot of the Postman UI
  • Generating a portable curl command for a CI script or shell test that shouldn't depend on Postman being installed

Common Mistakes

  • Pasting only the inner request object's fields without realizing a top-level request wrapper (if present) is also handled automatically — either shape works, so there's no need to manually unwrap it.
  • Expecting {{environment}} variables to be resolved to real values; they're carried over literally since the environment itself isn't part of a single request-item JSON.

Tips

  • In Postman, right-click a request and use "Copy" > "Copy as JSON" to get a request-item JSON in exactly the shape this tool expects.
  • If the generated command is missing a header you expected, check whether that header was marked disabled in the original Postman request.

References

Frequently Asked Questions