curl to wget
Convert curl commands to wget syntax — headers, POST data, auth, cookies, and common flags.
Looks like this contains credentials. They are converted in this tab only — not uploaded, and not included in the link that Share or Copy link produces.
Why would I convert curl to wget?
While curl and wget both download files and make HTTP requests, wget is often preferred for recursive downloads and mirroring sites, while curl is more common for API testing. Converting between them is useful when you have an existing curl command but need to use wget in a script. Key differences: wget follows redirects by default (no -L flag needed), and handles decompression automatically (no --compressed flag needed). The converter maps -H, -d, -u, -b, and more to their wget equivalents.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Converting a curl command for an environment that only has wget.
- Producing a download command for a script on a minimal image.
- Getting the header and POST-data syntax right in wget's vocabulary.
- Converting a command for a container that ships wget rather than curl.
- Checking whether wget can express the request at all.
Frequently Asked Questions
- What is the core difference between wget and curl?
- wget downloads to a FILE by default and can recurse through a site; curl writes to stdout and speaks far more protocols. For a single API call curl is the natural fit; for mirroring a directory tree, wget is.
- How do I get the body on stdout like curl?
- wget -qO- URL. The -O- sends output to stdout and -q suppresses the progress meter that would otherwise be interleaved on stderr. Without -O-, wget writes a file named after the URL path.
- How do I send a POST with a JSON body?
- wget --method=POST --body-data='{...}' --header='Content-Type: application/json' -qO- URL. Note --method and --body-data require wget 1.15+; older builds only offer --post-data, which forces POST.
- How do curl's -k and -L translate?
- --no-check-certificate for -k. Redirects need no flag — wget follows them by default (up to 20), unlike bare curl, so a curl -L command becomes a plain wget.
- Can wget retry a failed download?
- Yes, and it is a genuine strength: --tries, --continue to resume a partial file, and --waitretry to back off. curl needs --retry plus --continue-at to approximate the same behaviour.
- What does wget do that curl does not?
- Recursive download and mirroring — following links to fetch a whole site, with `--content-disposition` to honour server-supplied filenames. curl is the better tool for a single request; wget for retrieval.
Common errors and gotchas
- Assuming wget can do every method, when PUT and DELETE need `--method` and are not universally supported.
- Expecting output on stdout, when wget writes to a file unless told `-O -`.
- Losing curl's header syntax, since wget uses `--header` and repeats differently.
- Assuming redirects behave identically, where the two tools differ on method preservation.
- Using BusyBox wget, which supports a much smaller flag set than GNU wget.