Cookie Converter
Convert cookies between Netscape format and JSON and back. Runs entirely in your browser.
About This Tool
This tool converts browser cookies between Netscape/header format and structured JSON. Netscape cookie format (used by curl's cookie jar, wget, and many HTTP libraries) stores each cookie on one tab-separated line. JSON format is easier to read and manipulate programmatically. Use this when working with web scraping scripts, automating browser sessions, or debugging cookie behavior across different HTTP clients.
How to Use
- Choose the conversion direction: Netscape → JSON or JSON → Netscape.
- Paste your cookie data into the input field.
- Click Convert. The converted result appears in the output panel.
- Click Copy to copy the result to your clipboard.
Common Use Cases
- Feeding a raw DevTools cookie header into a scraping script: copy the entire
Cookie:header value from the Network tab, split it manually by semicolons into name/value pairs, then use the JSON to Netscape mode to produce a cookie jar file that curl or Python'srequestscan load directly. - Reusing a logged-in session in a Python automation script: export cookies from a browser extension as JSON, convert them to Netscape format here, and point
requests.get(url, cookies=...)or a curl--cookie-jarflag at the resulting file. - Migrating a saved session between two different HTTP tools: some tools only read Netscape format while others (like Postman or custom fetch scripts) expect JSON, this tool bridges the two without hand editing dozens of fields.
- Auditing what a site is actually storing: convert an exported cookie set to JSON to get a readable, indentable view of every domain, path, and expiry value at once instead of scanning a dense tab-separated file.
- Rebuilding an expired test session for QA: take a previously exported Netscape cookie file, convert to JSON, edit the expiry timestamp field, convert back to Netscape, and reload it into the testing tool.
Cookie Header vs Netscape File Format
A raw HTTP cookie header, the string you see in a browser's Network tab as Cookie: name1=value1; name2=value2, is a flat, single-line list with no metadata: no domain, no path, no expiry, no secure flag. It only tells the server which name/value pairs to associate with the request. The Netscape cookie file format is richer: each line is tab-separated and includes seven fields (domain, subdomain flag, path, secure flag, expiry, name, value), which is exactly the metadata a cookie jar needs to decide whether to resend that cookie on a later request. This tool works with the structured Netscape/JSON pair rather than the bare header string, since converting a bare header into a usable cookie jar requires supplying the missing domain, path, and expiry fields yourself.
Troubleshooting
- "Conversion error" when converting Netscape to JSON: each non-comment line needs exactly 7 tab-separated fields (domain, flag, path, secure, expiry, name, value). A line copied with spaces instead of real tab characters will fail to parse correctly, retype the tabs or re-export from the original source.
- JSON to Netscape fails with "Expected a JSON array": the input must be a JSON array of cookie objects, like
[{"domain":"example.com","name":"session","value":"abc"}], not a single object or a plain object map. Wrap a single cookie in square brackets. - Converted cookies don't work when loaded into curl or a script: double check the domain field starts with a leading dot if the original cookie was meant to apply to subdomains, and confirm the expiry is a Unix timestamp in seconds, not milliseconds.
- Secure or httpOnly flags seem to disappear after conversion: the Netscape format only tracks a secure flag, not httpOnly or sameSite. Those attributes exist in some browser export formats but have no equivalent column in classic Netscape format, so they are dropped during conversion.
Frequently Asked Questions
What is Netscape cookie format?
Netscape format stores each cookie as a tab-separated line with fields: domain, include-subdomains, path, secure, expiry, name, value. Lines starting with # are comments. This format is used by curl's --cookie-jar, Python's requests library cookie files, and wget.
How do I export cookies from Chrome?
Use a browser extension like "EditThisCookie" or "Cookie-Editor" to export cookies in JSON or Netscape format. Then paste the output here to convert it to the format needed by your script or HTTP client.
Is my cookie data safe?
Yes. The conversion runs entirely in your browser, no cookie data is sent to any server. However, treat exported cookies as sensitive data, they can authenticate as you on the sites they came from until they expire.
Can I convert a raw DevTools cookie header directly?
Not directly, a raw Cookie: header only contains name and value pairs with no domain, path, or expiry metadata. Build a minimal JSON array with the missing fields filled in (domain and path at minimum), then convert that to Netscape format here.
Why does my converted Netscape file have a leading dot on the domain?
A leading dot (like .example.com) signals that the cookie applies to all subdomains, not just the exact host. This is standard Netscape format behavior and matches how curl and most HTTP libraries interpret the domain field.