---
title: "HAR to cURL Converter"
description: "Convert HAR (HTTP Archive) files from browser DevTools to cURL commands. Reproduce network requests in your terminal for debugging and testing."
url: https://findutils.com/developers/har-to-curl/
category: developers
---

# HAR to cURL Converter

Convert HAR (HTTP Archive) files from browser DevTools to cURL commands. Reproduce network requests in your terminal for debugging and testing.

**Use this tool:** [HAR to cURL Converter](https://findutils.com/developers/har-to-curl/)

## Programmatic access

- REST id `har-to-curl`: POST https://api.findutils.com/api/tools/har-to-curl/execute (reference: https://findutils.com/api/har-to-curl/)
- MCP tool `har_to_curl` on https://mcp.findutils.com (reference: https://findutils.com/mcp/har-to-curl/)

## Why Convert HAR to cURL?

HAR files capture all network requests from your browser. Converting them to cURL lets you replay specific requests from the command line, share reproducible API calls, and debug issues outside the browser.

## Tips for Better Results

- Filter requests in DevTools before exporting to keep your HAR file focused on the requests you actually need, rather than exporting hundreds of unrelated asset loads.
- Use the 'Include Cookies' option carefully. Cookies may contain active session tokens that could be misused if shared. Strip them out before adding cURL commands to bug reports or documentation.
- Enable 'Preserve log' in DevTools before recording so that page navigations and redirects are captured in the HAR file for a complete request timeline.
- Combine this tool with the cURL to Code converter to go from browser request to production-ready code in Python, JavaScript, or any other language.
- For large HAR files with hundreds of entries, look for specific requests by searching the output for domain names or URL paths rather than scrolling through every command.

## FAQ

### How do I export a HAR file?

In Chrome/Firefox DevTools, go to the Network tab, right-click on any request, and select 'Save all as HAR with content'. You can also use the export button in the Network tab toolbar.

### Why are some headers skipped?

Certain headers like:method,:path, Host, and Content-Length are automatically set by cURL based on the request. Including them would cause errors or duplicates.

### Can I convert a single request?

Yes, you can export a single request as HAR from DevTools. Alternatively, use browser extensions that let you copy requests directly as cURL commands.

### Is my HAR data safe when using this tool?

Yes. All processing happens entirely in your browser using client-side JavaScript. No HAR data, cookies, or headers are uploaded to any server. This is especially important since HAR files often contain session tokens and authentication credentials.

### What HAR format versions are supported?

The converter supports HAR 1.2, which is the current standard used by all major browsers including Chrome, Firefox, Edge, and Safari. Older HAR 1.1 files are also compatible.

### Can I convert HAR files with hundreds of requests?

Yes. The converter processes the entire log.entries array regardless of size. For very large HAR files, the output may take a moment to render, but there is no hard limit on the number of entries.

### How do I handle POST requests with form data?

The converter automatically detects POST bodies in the HAR entry's postData field and includes them in the cURL command using the -d or --data flag. Multipart form data and JSON payloads are both supported.

### What is the difference between short and long form flags?

Short form uses compact flags like -H, -X, and -d. Long form uses the full names like --header, --request, and --data. Long form is more readable in documentation and scripts, while short form is faster to type in the terminal.

### Can I use this tool to generate cURL commands for load testing?

Yes. Export a HAR file of your critical user flow, convert to cURL commands, then adapt them into load testing scripts for tools like Apache Bench, wrk, or k6. The generated commands serve as accurate request templates.

### Why does my cURL command fail with a 401 or 403 error?

The original request likely used session cookies or authorization tokens that have since expired. Re-export the HAR file with a fresh session, convert again, and the new cURL commands will include valid credentials.

## Related Tools

- [Postman to cURL](https://findutils.com/developers/postman-to-curl/)
- [cURL to Code](https://findutils.com/developers/curl-to-code/)
- [JSON Formatter](https://findutils.com/developers/json-formatter/)
- [API Docs Generator](https://findutils.com/developers/api-docs-generator/)
- [HTTP Status Code Lookup](https://findutils.com/network/http-status-code-lookup/)
- [Security Headers Analyzer](https://findutils.com/network/security-headers-analyzer/)
- [Cookie Analyzer](https://findutils.com/security/cookie-analyzer/)
- [OpenAPI Validator](https://findutils.com/developers/openapi-validator/)
