cURL to Go
Paste a curl command and get equivalent Go code using net/http, with headers, JSON body, cookies, and auth already translated.
curl Command
Go (net/http)
Copied to clipboard.
Summary
Paste a curl command and get equivalent Go code using net/http, with headers, JSON body, cookies, and auth already translated.
How it works
- Paste a curl command, including one copied from a browser devtools network tab.
- The parser tokenizes the command, honoring quotes and backslash line continuations.
- Flags such as -X, -H, -d, -b, -u, -F, and -G are mapped to their net/http equivalents.
- A JSON body is detected automatically and sent with a Content-Type header set for you.
- The generated Go program appears in the output box, ready to copy into a main.go file.
Use cases
- Turn a "Copy as cURL" request from browser devtools into a Go test program.
- Reproduce an API call from documentation or a support ticket in Go.
- Convert a curl example from a README into a starting point for a Go client.
- Debug an API integration by replaying the exact request curl sent, in Go.
- Translate a webhook test command into a repeatable Go program.
- Build a quick net/http client around a request captured from a mobile app proxy.
Frequently Asked Questions
Last updated: 2026-07-23 ·
Reviewed by Nham Vu