Skip to content

Menu

HTTP Header Generator

Generate common HTTP headers

Runs entirely in your browserAPI & HTTPFree, no sign-up
Loading tool

01What is HTTP Header Generator?

Most of us copy HTTP headers from an old project or a half-remembered blog post. This generator gives you a cleaner starting point. Pick one of five presets and it lists a set of headers, each with a value, a short description and a category tag. REST API covers Content-Type and Accept as application/json, a Bearer Authorization placeholder, X-Request-ID and Cache-Control: no-cache. Security has HSTS with includeSubDomains and preload, X-Content-Type-Options: nosniff, X-Frame-Options: DENY, a starter Content-Security-Policy, Referrer-Policy and Permissions-Policy. It also sets X-XSS-Protection to 0, which is what OWASP now advises, because the old browser XSS auditor could itself be abused. The CORS preset follows the Fetch standard's rules. It names one specific origin and adds Vary: Origin, because a wildcard origin is not allowed together with Access-Control-Allow-Credentials: true. Cache shows an immutable Cache-Control for static files, ETag, Last-Modified, Vary and Expires. Rate Limit gives X-RateLimit-Limit, Remaining, Reset and Retry-After. You can delete any header with its trash icon or add your own with the name and value fields. Names are checked against the token rule in RFC 9110, so spaces and colons are rejected. Values with line breaks are refused too, since those could split a header. The Format dropdown changes the output. Raw prints Name: value lines. cURL prints one -H flag per header with line continuations. Fetch API and Axios both print a headers: object literal ready to paste into a request config. A short worked example: the first two CORS headers in cURL format come out as -H 'Access-Control-Allow-Origin: https://app.example.com' and -H 'Vary: Origin' on the next line. The cURL output is quoted for POSIX shells, so a CSP value containing 'self' survives copy and paste intact. In the object formats, a header added twice is merged into one comma-separated value under the first spelling, as RFC 9110 permits for list-based fields. Watch out with Set-Cookie, which is the known exception to that rule. Two honest limits. Only the REST preset holds request headers. The others are response headers your server sends, and the tool shows a note when you pick a request format for them. Every value is a placeholder, so swap tokens, origins, dates and IDs for real ones. Everything is generated in your browser.

Backend and DevOps engineers who need a correct set of security, CORS, cache or API headers to paste into a server config or a request. The tool runs entirely in your browser, so your data never leaves your device.

02How to use HTTP Header Generator

  1. Choose a Preset from the dropdown or load an example.
  2. Remove headers you don't need with the trash icon.
  3. Add custom ones with the Header-Name and header-value fields, then click Add.
  4. Choose a Format: Raw, cURL, Fetch API or Axios.
  5. Copy the output and replace the placeholder values.

03Worked examples

Input: Content-Type: application/json, Content-Security-Policy: default-src 'self' (Raw)
Result: Content-Type: application/json Content-Security-Policy: default-src 'self'
Input: Same headers (cURL)
Result: -H 'Content-Type: application/json' \ -H 'Content-Security-Policy: default-src '\''self'\'''
Single quotes inside a value are escaped as '\'' so the shell passes 'self' through intact.
Input: Accept: text/html and accept: application/json (Fetch)
Result: headers: { "Accept": "text/html, application/json" }
Repeated header names, matched case-insensitively, are merged into one comma-separated value with the first spelling kept.
Input: CORS preset, first two headers (Axios)
Result: headers: { "Access-Control-Allow-Origin": "https://app.example.com", "Vary": "Origin" }
Trimmed to two headers. These are response headers, so the tool notes they belong on the server.
Input: Rate Limit preset (Raw)
Result: X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 1704067200 Retry-After: 60
Reset is a Unix timestamp here. Some APIs send seconds remaining instead.
Input: Custom header name "X Api"
Result: Rejected: Header names can only contain letters, digits and !#$%&'*+-.^_`|~ (no spaces or colons).
Names must be RFC 9110 tokens. X-Api-Key passes.

04Common use cases

  • Adding baseline security headers to an Nginx or Express app before a penetration test
  • Building a cURL command with auth and tracing headers to reproduce a bug report against a REST endpoint
  • Setting CORS headers for a single-page app on app.example.com talking to an API on another domain
  • Documenting rate-limit response headers in an API reference
  • Writing the headers object for a fetch or Axios wrapper in a React project
  • Checking that a header name you invented is a valid HTTP token before shipping it

05Tips

  • Access-Control-Allow-Origin: * can't be combined with Allow-Credentials: true. Browsers reject it, so echo a specific origin and send Vary: Origin.
  • Only add preload to HSTS once every subdomain serves HTTPS. Getting removed from browser preload lists takes a long time.
  • Current browsers ignore X-XSS-Protection. Send 0 or omit it, and put your effort into Content-Security-Policy.
  • Ship CSP as Content-Security-Policy-Report-Only first to see what it would break.
  • Don't add Set-Cookie twice in the Fetch or Axios format. The merge joins values with a comma, which breaks cookies.

06Related concepts

HTTP headers, CORS, Content-Security-Policy, HSTS, Cache-Control.

Frequently Asked Questions

What is HTTP Header Generator?

HTTP Header Generator is a free, browser-based developer tool on AIDToolStack. Generate common HTTP headers It requires no installation or sign-up and works entirely in your browser.

Is HTTP Header Generator free to use?

Yes. No sign-up, no fees and no usage cap.

Does HTTP Header Generator store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe