03 / API & Auth / bearer-token-header

Bearer Token Header Generator

Generate an Authorization Bearer header from an access token.

ReadyLocal processing
03 · Workspace

How to use

  1. 01Paste your access token into the Bearer token box. The header updates as you type.
  2. 02If the value starts with "Bearer ", that prefix is stripped so it is not doubled. Paste the value only, not the "Authorization:" header name.
  3. 03The token is masked on screen by default; tick Show token when you need to check it.
  4. 04Press Copy Header for the complete Authorization line, or Copy Token for the raw token.

What is this tool?

Bearer tokens are the standard way OAuth 2.0 and most modern APIs authenticate requests. This tool trims the token, removes an accidental Bearer prefix and formats it as Authorization: Bearer <token>. The on-screen preview masks the middle of the token by default, while the copy buttons always copy the full value. Everything is processed locally in your browser.

Authorization: Bearer header format

RFC 6750 defines the header as the word Bearer, one space, then the token: Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.... The token can be a JWT or an opaque string; the format is the same either way. A common mistake is ending up with Bearer Bearer <token> after copying a value that already had the prefix. This tool strips a leading Bearer (in any letter case) and surrounding whitespace, so the output always has exactly one.

In curl, add it with -H 'Authorization: Bearer <token>'. In fetch(), set headers: { Authorization: 'Bearer ' + token }.

Why APIs return 401 for a bearer token

A 401 Unauthorized response with a WWW-Authenticate: Bearer header usually means the token is missing, malformed, expired or signed for a different audience. Check the header first: a missing space, a doubled prefix or a line break in the copied token will all fail. If the token is a JWT, paste it into the JWT Decoder to check exp and aud. A 403 Forbidden instead means the token was accepted but lacks the scope or role the endpoint needs.

Bearer tokens grant access to whoever holds them, so treat them like passwords. The masked preview helps during screen shares, but copied headers contain the full token, so avoid pasting them into tickets or chat.

Is it safe to paste a token into an online header tool?

It depends on where the processing happens. This page formats the token with plain string operations in your browser tab and makes no network request with it; reloading or closing the tab discards it. The general rule still applies: only paste live production tokens into tools you trust, and prefer short-lived or test tokens.

If a token has been exposed in a screenshot, log or chat message, revoke it or let it expire rather than relying on it staying private.

Common use cases

  • Calling an OAuth 2.0 protected API from cURL
  • Adding auth headers to API client collections
  • Keeping a token hidden on screen during a screen share or demo
  • Quickly reformatting a token copied from a login response
  • Fixing a doubled Bearer Bearer prefix in a request

FAQ

What is a bearer token?

A credential that grants access to whoever holds (bears) it, usually an OAuth 2.0 access token or a JWT.

Is my token uploaded?

No. The token stays in your browser tab.

Why is the token masked?

To protect it during screen shares and screenshots. Copy Header and Copy Token always copy the full, unmasked value.

Do I include the word Bearer?

No need. The tool adds it for you, and if your pasted value already starts with Bearer, it is removed so the prefix is not doubled.

What is the difference between a bearer token and a JWT?

Bearer describes how the token is sent; JWT describes one format the token can take. Many bearer tokens are JWTs, but some are opaque random strings.

Is Bearer case-sensitive?

RFC 7235 treats the auth scheme name as case-insensitive, but Bearer with a capital B is the conventional spelling and the safest choice for strict servers.