Self-Signed Certificate Generator
Make HTTPS work on localhost, a test domain or a device on your network: certificate and key in PEM, DER and PFX, generated in your browser.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Pick a preset
Start from localhost, a dev domain with a wildcard, a device IP, a local root CA or a client certificate.
- 2Enter the names
Fill in the Common Name and list every host name and IP address in Subject Alternative Names, one per line.
- 3Choose key and validity
Pick RSA or ECDSA, the usage, the start date and the number of days (397 or less for servers).
- 4Add a PFX password
Type a password if you need a .pfx file for Windows, IIS or Java, and optionally encrypt the PEM key too.
- 5Generate and download
Press Generate, then download the ZIP or each file: certificate PEM, CRT, key and PFX.
- 6Trust and use it
Follow the Install and use tab to trust the certificate and configure nginx, Node or Vite.
About this tool
Service workers, secure cookies, the camera API and many OAuth providers only work over HTTPS, so local development and home-lab devices need a certificate. A public certificate authority will not issue one for localhost or 192.168.1.50, which leaves a self-signed certificate: one that signs itself instead of being signed by a CA. This generator builds a proper X.509 version 3 certificate with Web Crypto in your browser. Choose an RSA key (2048, 3072 or 4096 bits) or an ECDSA key on P-256 or P-384, fill in the names, and list every host name and IP address in Subject Alternative Names, which is the only place modern browsers look. The certificate gets the right extensions for its job: basic constraints, key usage, extended key usage for a TLS server, client or both, and key identifiers. A local root CA mode is included for people who want to trust one root and sign other certificates later. Download the certificate as PEM or DER, the private key as PEM (optionally encrypted), a password-protected PFX for Windows, IIS and Java, or everything in one ZIP with a short readme.
Why browsers ignore the Common Name
Since 2017 Chrome, and now every major browser, checks only the Subject Alternative Name extension when matching a host name. A certificate with CN=localhost but no SAN entry fails with a name mismatch even after you trust it. The checks under the form warn about this, about wildcards that are too broad and about a CN that is missing from the SAN list.
Validity periods
Apple platforms refuse TLS server certificates valid for more than 825 days, even ones you have trusted yourself, so the default is 397 days, the limit public CAs use. A local root CA can last ten years because the rule applies to the certificates that serve websites, not to roots.
The PFX file
The PFX (PKCS#12) file holds the certificate and the encrypted key together. The key is protected with PBKDF2 and AES-256 and the file has a SHA-256 integrity check, the defaults of OpenSSL 3. Windows 10 and 11, IIS, Java keytool, .NET and Node accept it. Very old systems, such as Windows 7 and some older macOS Keychain versions, expect the legacy 3DES format; convert with openssl pkcs12 -legacy if you need it.
Limits
A self-signed certificate is not trusted by anyone until they install it, so it is for development, testing and private devices, not for a public website: use a CA such as Let's Encrypt there. The private key exists only in this page; it is not stored or sent, so save it before you leave. Nothing here bypasses or weakens certificate checks on other people's devices.
Worked example
A developer needed HTTPS for a Vite app at https://myapp.test and for a phone on the same Wi-Fi at 192.168.1.40. She used the Dev domain with wildcard preset, added 192.168.1.40 and localhost, kept ECDSA P-256 and 397 days, and typed a PFX password. The certificate listed 4 SAN entries and was valid until 7 December 2027. She trusted myapp.test.crt in the macOS System keychain, pointed Vite at the PEM files and opened the site without a warning; the PFX went into a .NET test server.
Quick facts
- Category: Security & Privacy
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: RFC 5280 Internet X.509 PKI Certificate and CRL Profile
Frequently asked questions
Is it safe to create a private key in a web page?
The key is generated by your browser's Web Crypto engine from its secure random source, exactly as OpenSSL would on your computer. It never leaves the page and is not stored, which is why you should download it before closing the tab.
Why does my browser still show a warning?
A self-signed certificate is only trusted after you add it to your system or browser trust store. Use the Install and use tab for Windows, macOS, Linux, Firefox, Android and iOS. Also check that the address you open is listed in the SAN entries.
RSA or ECDSA?
ECDSA P-256 is smaller and faster and works in every current browser, server and language. RSA 2048 is the safe choice for very old clients, some Java versions and hardware such as older printers and routers.
Can I use it on a public website?
Visitors would see a security warning, because they have not trusted your certificate. For public sites use a free certificate from a CA such as Let's Encrypt. Self-signed certificates suit localhost, test environments, intranets and devices you control.
What is the local root CA option for?
It makes a certificate with the CA flag set, meant to be trusted once on each device. You can then sign server certificates with it using OpenSSL or mkcert, and every device that trusts the root accepts them.
How do I make a PEM certificate and key into a PFX later?
Run openssl pkcs12 -export -in cert.pem -inkey key.pem -out cert.pfx and choose a password. This page can also make the PFX directly when you type a PFX password before generating.
