JSON to HTTP headers converter
Handy when moving headers from code or config into curl, an .http file or API docs.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter json and multiple values.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Each key becomes a Name: value line. Arrays are written as repeated lines or joined with a comma and space, as you choose. Names are checked to be RFC 9110 tokens and values must not contain line breaks, which prevents header injection.
Example
Inputs: Multiple values = Repeated lines. Result: Header lines: Content-Type: application/json Authorization: Bearer TOKEN Accept-Language: ar Accept-Language: en;q=0.8; Lines: 4.
{
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN",
"Accept-Language": ["ar", "en;q=0.8"]
}Content-Type: application/json Authorization: Bearer TOKEN Accept-Language: ar Accept-Language: en;q=0.8
Limits and caveats
- Nested objects are not accepted as values, and null becomes empty.
- Do not join Set-Cookie values with commas, which breaks them; use repeated lines for it.
Questions about this tool
When should values be joined with commas?
Most headers such as Accept mean the same when joined with a comma and space; Set-Cookie is the exception and must repeat.
Are the curl options safe to paste in a terminal?
Yes. Each header is wrapped in single quotes and any single quote inside is escaped the bash way.
Why is a name with a space rejected?
HTTP header names cannot contain spaces or characters such as : and ( ), and servers reject such requests.
