Skip to content

cURL & HAR to JMeter JMX Converter

Convert cURL commands and HAR files into valid Apache JMeter JMX test plans. Supports GET, POST, PUT, DELETE, PATCH, and RFC 9838 QUERY.

Difficulty
beginner
Guide type
reference
Estimated read time
3 min read
Presets:
HTTP Samplers-
Format Detected-
Target Hosts-
⚠️ Notice / Warnings:

    Parsed Endpoints

    Generated Apache JMeter JMX XML

    JMeter 5.6.3 Valid

    🤖 Add this conversion tool to your AI Agent (MCP)

    Claude Code, Cursor, Windsurf, and other agents can call convert_curl_or_har_to_jmx directly over Model Context Protocol:

    claude mcp add jmeter-docs https://docs.jmeter.ai/api/mcp --transport http

    Client-side Browser Security: All on-page conversions run 100% locally in your browser. When using the hosted MCP endpoint (/api/mcp), ensure sensitive production passwords and API keys are redacted. See HTTP Request Sampler Manual and JMeter MCP Reference.

    Creating JMeter test plans manually for dozens of API endpoints is slow and error-prone. This converter takes raw cURL commands (from Swagger, Postman, browser DevTools, or terminal history) and HAR 1.2 network captures, automatically structuring them into a production-grade Apache JMeter 5.6.3 .jmx test plan.

    1. HTTP Request Defaults (ConfigTestElement): Detects the dominant target domain across your requests and parameterizes it into ${BASE_URL}, making environment switching (Dev $\to$ Staging $\to$ Prod) effortless.
    2. HTTP Header Manager (HeaderManager): Preserves required custom headers (Content-Type, Accept, X-Api-Key), while stripping transport-level noise (Content-Length) that JMeter calculates dynamically.
    3. HTTP Cookie Manager (CookieManager): Auto-injected to manage session cookies and cross-request state across iterations.
    4. Auth Parameterization: Automatically detects Authorization: Bearer <token> and parameterizes it as ${AUTH_TOKEN} in User Defined Variables.
    5. Robust Timeouts: Connect timeout is preset to 5000ms and response timeout to 15000ms on every sampler to prevent thread pool lockup during load spikes.
    6. Response Code Assertions: Generates baseline ResponseAssertion elements validating HTTP 200, 201, and 204 status codes.

    Full HTTP Method Support (Including QUERY RFC 9838)

    Section titled “Full HTTP Method Support (Including QUERY RFC 9838)”

    The converter supports all standard and modern HTTP methods:

    MethodJMeter ImplementationUse Case
    GETHTTPSamplerProxy (Query Params in Arguments or Path)Fetching resources and reading data
    POSTHTTPSamplerProxy (postBodyRaw="true" or Form fields)Creating resources / authentication
    QUERYHTTPSamplerProxy (postBodyRaw="true", Method=QUERY)Safe, idempotent complex queries with JSON payload bodies (Elasticsearch, GraphQL, modern REST)
    PUTHTTPSamplerProxy (postBodyRaw="true")Full resource replacement
    PATCHHTTPSamplerProxy (postBodyRaw="true")Partial resource modification
    DELETEHTTPSamplerProxyRemoving resources
    HEAD / OPTIONSHTTPSamplerProxyHealth checks and CORS preflight
    Terminal window
    curl -X QUERY "https://api.example.com/v1/catalog/search" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sample-jwt-token-xyz" \
    -d '{
    "filter": { "status": "in_stock", "price": { "lte": 150 } },
    "sort": "price:asc"
    }'

    The converter translates this into a valid JMeter HTTP Sampler with the QUERY method and raw payload body configured without requiring custom plugins.


    Once you download the .jmx file, run it in non-GUI mode from your terminal:

    Terminal window
    jmeter -n -t test-plan.jmx -l results.jtl -e -o ./report

    You can override virtual users dynamically at runtime:

    Terminal window
    jmeter -n -t test-plan.jmx -Jthreads=100 -l results.jtl -e -o ./report

    To run for a fixed duration, set Duration to a value greater than zero before downloading the plan. This enables JMeter’s scheduler and generates the required infinite-loop behavior; adding -Jduration to a plan converted with Duration 0 does not enable the scheduler.


    You can call this converter directly inside Claude Code, Cursor, Windsurf, Qwen Code, and Copilot via our free Model Context Protocol server:

    Terminal window
    claude mcp add jmeter-docs https://docs.jmeter.ai/api/mcp --transport http --scope user

    Prompt your AI agent:

    “Convert this cURL command into a JMeter test plan with 50 threads and 10s rampup: curl -X QUERY https://api.example.com/v1/search -H 'Content-Type: application/json' -d '{\"query\":\"loadtest\"}'

    Your agent calls convert_curl_or_har_to_jmx and outputs schema-valid XML ready for execution.

    On this page