Cookie header to JSON converter

Helps when debugging sessions and logins and checking what the browser sends with each request.

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

  1. Enter cookie header and decode %xx in values.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

The Cookie: prefix is removed, the header is split on ; and each part at the first = into name and value, surrounding double quotes are removed as RFC 6265 allows, then %XX is decoded if the option is on.

Example

Inputs: Decode %XX in values = yes. Result: JSON: { "session_id": "abc123", "theme": "dark", "lang": "ar", "cart": "{\"items\":2}" }; Cookies: 4; Duplicate names skipped: 0.

Cookie: session_id=abc123; theme=dark; lang=ar; cart=%7B%22items%22%3A2%7D
{
  "session_id": "abc123",
  "theme": "dark",
  "lang": "ar",
  "cart": "{\"items\":2}"
}

Limits and caveats

  • When a name repeats the first value is kept, which is what most libraries read, and the duplicates are counted.
  • Parts without an = sign are ignored.

Questions about this tool

Why can a cookie name repeat?

The browser sends two cookies with the same name when their path or domain differ, putting the more specific one first.

Should I decode the values?

Turn it on when values are %XX-encoded, and off to see each value exactly as sent.

Does this work for Set-Cookie headers?

No. Set-Cookie comes from the server with attributes such as Path and Expires, and has its own tool in this section.