Home › Developer Tools › Basic Auth Header Generator

Basic Auth Header Generator

Create an HTTP Authorization: Basic header from a username and password, with ready-to-run cURL, fetch and Python examples, or paste an existing header to decode the credentials. Everything runs locally in your browser.

Last updated:

Mode
Enter your values to see the result.
Advertisement
Advertisement

How to use the Basic Auth Header Generator

  1. Choose Create header to build one, or Decode header to read one.
  2. Enter the username and password (or paste the header to decode).
  3. Add the request URL to personalize the code examples.
  4. Copy the header with Copy results, or copy a code example.
  5. Send it over HTTPS only, since Base64 can be decoded by anyone.

Basic authentication format (RFC 7617)

Authorization: Basic base64(username + ":" + password)

The client sends this header with every request. If it is missing or wrong, the server answers 401 Unauthorized with a WWW-Authenticate: Basic realm="…" header, which makes browsers show a login prompt.

Examples

Username : passwordBase64 token
Aladdin:open sesameQWxhZGRpbjpvcGVuIHNlc2FtZQ==
user:passdXNlcjpwYXNz
admin:adminYWRtaW46YWRtaW4=
api:YXBpOg==

Some APIs use an API key as the username and leave the password empty (the trailing colon is still required), or the reverse. Check your API documentation.

Security tips

  • Always use HTTPS; Base64 hides nothing.
  • Prefer dedicated API tokens over your account password, and rotate them.
  • Don't commit headers or tokens to source control; use environment variables.

Frequently asked questions

How is a Basic Auth header built?

Join the username and password with a colon, encode the result as Base64 and put it after 'Basic '. For the username Aladdin and password open sesame, Aladdin:open sesame becomes QWxhZGRpbjpvcGVuIHNlc2FtZQ==, so the header is Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==.

Is Basic authentication secure?

Only over HTTPS. Base64 is a reversible encoding, not encryption, so anyone who intercepts the header can read the password. Over HTTPS the whole request, including the header, is encrypted in transit.

Can the username contain a colon?

No. The server splits the decoded string at the first colon, so a colon in the username would break it. The password may contain colons.

How do I use Basic auth with cURL?

Use curl -u 'user:password' https://example.com, and cURL builds the header for you, or send it yourself with -H 'Authorization: Basic <token>'. Both examples are generated with your values.

What about non-English characters?

RFC 7617 lets servers ask for UTF-8 with charset="UTF-8". This tool always encodes the username and password as UTF-8 bytes before Base64, which is what modern browsers and HTTP clients do.

Are my credentials sent anywhere?

No. The header is built and decoded with JavaScript in your browser. Nothing is uploaded, logged or stored on a server.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Base64 Encoder DecoderEncode or decode Base64 text and files, and make data URIs.JWT DecoderDecode JSON Web Tokens, read the claims and expiry, and verify HS256 signatures.Htpasswd GeneratorCreate .htpasswd entries with bcrypt, APR1-MD5 or SHA-1 for Apache and Nginx basic auth.URL Encoder DecoderPercent-encode or decode URLs, query strings and form data.Email ValidatorCheck email lists and spot disposable addresses.Website Down CheckerCheck if a website is down for everyone.Deep Link GeneratorCreate links that open directly in apps.URL ParserBreak a URL into its parts and edit query string parameters with a live rebuild.User Agent ParserSee your user agent and parse any UA string into browser, OS, engine and device.HTTP Status CodesSearch every HTTP status code with plain-English meanings, causes, fixes and RFC references.Subnet CalculatorCalculate IPv4 network, broadcast, host range, masks and host count, and split subnets.Bulk URL OpenerOpen a list of URLs in new tabs at once or in batches, with cleanup, dedupe and delay.DNS LookupLook up A, AAAA, MX, TXT, NS, CNAME, SOA and CAA records with TTLs over secure DNS.API Request TesterSend GET, POST, PUT and DELETE requests with headers and a body, then inspect the response.WebSocket TesterConnect to a ws:// or wss:// server, send messages and watch a timestamped live log.WHOIS LookupLook up who registered a domain or IP: registrar, creation and expiry dates, name servers, status.Mailto Link GeneratorBuild encoded mailto: links with cc, bcc, subject and body, plus HTML code and a QR code.WhatsApp Link GeneratorCreate wa.me click-to-chat links with a pre-filled message, button HTML and a QR code.Common Ports ListSearchable TCP/UDP port number list with service, protocol and description, filterable by range.DMARC CheckerLook up a domain's DMARC record, explain every tag, grade the policy and get fix suggestions.DMARC Record GeneratorCreate a DMARC TXT record with policy, reporting and alignment options, every tag explained.Email Header AnalyzerPaste raw email headers to trace every server hop, see delays and check SPF, DKIM and DMARC.IP Geolocation LookupFind the country, city, ISP, ASN and time zone of any IP address or domain, with a map.Reverse DNS LookupFind the PTR hostname of any IPv4 or IPv6 address, one at a time or hundreds in bulk.SPF Record CheckerLook up a domain's SPF record, count nested DNS lookups, find errors and test a sender IP.SPF Record GeneratorBuild a valid SPF TXT record from mail providers, IPs and includes, with a lookup-count check.CIDR to IP RangeConvert IPv4 or IPv6 CIDR blocks to first/last IP, mask and host count, and export IP lists.DNS Propagation CheckerCompare DNS answers and TTLs from Cloudflare, Google, Quad9, AdGuard and NextDNS side by side.Domain Availability CheckerCheck if domain names are available across .com, .io, .ai and more, with registrar and expiry.MAC Address LookupFind the vendor of a MAC address or OUI, check multicast and random bits, look up many at once.MX LookupFind a domain's mail servers: MX priority, host, IP addresses and the email provider.Uptime SLA CalculatorTurn 99.9% uptime into allowed downtime per day, month and year, or downtime into uptime %.Website Speed TestTest page speed with Lighthouse: performance score, Core Web Vitals and fixes, mobile or desktop.ASN LookupLook up an AS number or IP: network owner, country, registry, abuse contact and announced prefixes.Bandwidth CalculatorEstimate monthly website bandwidth (GB) and the Mbps you need from page views and page size.CNAME LookupFollow a hostname's full CNAME chain to its final IP addresses, with TTLs and CDN detection.CORS TesterSend GET, POST or OPTIONS from your browser to any API and see whether CORS allows it and why not.DKIM Record CheckerLook up a domain's DKIM key by selector (or auto-detect), check key type, bit length and tags.VLSM CalculatorSplit a network into variable-length subnets sized to the hosts each one needs.YouTube Timestamp Link GeneratorMake YouTube links that start at a set time, embed start/end codes and lists of timestamps.DKIM Record GeneratorCreate a DKIM RSA key pair in your browser with the TXT record, selector host and private key PEM.DMARC Report AnalyzerRead DMARC aggregate XML reports (.xml, .gz, .zip): sources, SPF/DKIM alignment and pass rates.Domain Age CheckerSee how old a domain is, when it was registered and when it expires. Bulk check up to 50.Email Deliverability CheckerGrade a domain's MX, SPF, DMARC, DKIM, BIMI and MTA-STS records in one report with fixes.Email ObfuscatorHide an email address from spam bots with HTML entities, a JavaScript mailto link or reversed CSS text.Email PermutatorGenerate every common business email format from a first name, last name and company domain.HTTP Header ParserPaste raw HTTP headers to get a table explaining each one plus a security headers grade.IP Blacklist CheckerCheck an IPv4 address against 21 public spam blocklists (DNSBLs) and see listed or clean.IP Range to CIDRTurn a start and end IP into the shortest list of CIDR blocks, for IPv4 and IPv6.IPv6 Subnet CalculatorIPv6 prefix to network, range, address count and /64s, and split it into child subnets.Link in Bio Page GeneratorCreate a link-in-bio page with avatar, bio, links and theme, then download it as one HTML file.NS LookupFind a domain's authoritative nameservers with their IPs, SOA record and DNS hosting provider.Social Share Link GeneratorMake share links and buttons for Facebook, X, LinkedIn, Reddit, Pinterest, WhatsApp and email.Subnet Mask Cheat SheetInteractive /0 to /32 table of subnet masks, wildcards and host counts with details per prefix.TXT Record LookupLook up a domain’s DNS TXT records and see which are SPF, DMARC, DKIM or verification tokens.
See all 52 Network, DNS & Email Tools →