Basic Auth Header Generator
Generate a properly UTF-8-safe Basic Authentication header from a username and password.
About this tool
The Basic Auth Header Generator builds a ready-to-use HTTP Authorization header for Basic Authentication (RFC 7617) from a username and password. Enter both fields and the tool immediately produces the header value in the exact format servers expect: the literal string "Basic " followed by the Base64 encoding of "username:password".
A common bug when building this by hand in JavaScript is calling btoa(username + ':' + password) directly — btoa() only handles Latin1 characters and throws or silently corrupts output for credentials containing non-ASCII characters. This tool uses a proper UTF-8-safe encoding pipeline (TextEncoder into a byte string, then Base64), so credentials with any Unicode content encode and decode correctly.
A show/hide toggle on the password field lets you type or paste sensitive values without them being visible by default, and a decoded preview shows exactly what "username:password" string is being encoded — a deliberate reminder that Base64 is not encryption.
Common use cases: quickly generating a header value to paste into Postman, curl, or an API client during development; debugging why a Basic Auth request is being rejected; and understanding what Basic Auth actually sends over the wire. Everything runs client-side — no credentials are transmitted anywhere.
