BrowserLeaksUSBrowserLeaksUS

Cookie Converter

Convert cookies between different formats

Input

Format:
Output:

What this tool does

Converts between Netscape (cookies.txt) format and JSON, pretty-prints cookie strings, and displays individual cookie attributes (Path, Domain, Expires, Secure, HttpOnly, SameSite). Fully client-side.

Who it's for: Developers debugging cross-domain cookie issues, QA engineers inspecting browser state, and scraper authors handling cookie jars.

When to use

  • •Convert an exported cookies.txt file to JSON for use in a Node scraper.
  • •Inspect a Cookie request header for missing attributes.
  • •Debug why a cookie isn't being sent across subdomains.
  • •Extract cookies from a browser extension export.

How it works

  1. 1Paste a cookie string or cookies.txt content.
  2. 2Tool detects format and converts.
  3. 3Each cookie is broken down by attribute.
  4. 4All parsing happens in your browser.

Tips

  • •SameSite=None requires Secure - otherwise modern browsers reject the cookie.
  • •Cookies without a Domain attribute default to the origin (no subdomains).
  • •HttpOnly cookies are not readable from JavaScript - useful for session tokens.

Using this result

How to read a cookie conversion

01

Header, jar, and JSON

A cookie header is a single line of name=value pairs separated by semicolons, which is what a browser sends on a request. A Set-Cookie line is the response form, and it can carry attributes the request form does not: Domain, Path, Expires, Max-Age, Secure, HttpOnly, SameSite. This page converts between those shapes and JSON so you can read the attributes instead of parsing the semicolon by eye. The JSON view is the one to edit. Names and values are separate fields there, so a value that itself contains an equals sign stays intact.

Convert request cookies when you copied a Cookie header out of devtools and you want a list. Convert Set-Cookie when you copied a response and you need to see whether HttpOnly or SameSite is present. Missing SameSite matters. Browsers now treat a missing SameSite as Lax in many cases, which stops the cookie on cross-site posts. Secure means the cookie is only sent on HTTPS. HttpOnly means JavaScript on the page cannot read it. A converter cannot make those flags true. It can only show you whether they were in the source line.

02

What the conversion will not fix

Pasting a cookie into this box does not set it on a site, and copying the result into a different browser does not log you in if the cookie is bound to a device or an IP. Session cookies with no Expires are gone when the browser closes. A far-future Expires is a persistent cookie. If the date looks wrong, it may be in the cookie's GMT format. Run that date through Timestamp if you need it in local time.

Do not paste production session cookies into a machine you do not control. The value is a credential even when the name looks harmless. Strip comments and surrounding quote characters before you convert. A JSON error usually means a trailing comma you added in the editor, not a bad cookie. Use JSON Formatter on the JSON view if you want it pretty-printed before you convert back.