TXT · Text & Data tools

CSR and Self-Signed Certificate Generator

Key

Key type
Signature hash

Subject

Common name (CN)
Organization (O)
Unit (OU)
Locality (L)
State (ST)
Country (C)

Two-letter ISO code

Email

Subject alternative names

DNS names and IPs

2 names: localhost, 127.0.0.1

CSR (PEM)
Private key (PKCS#8)
Public key (SPKI)
Decoded
Equivalent openssl command
ECDSAkeyP-256size2sans—validity0der bytes

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

Generate a certificate signing request to send to a certificate authority, or a self-signed certificate for a local HTTPS server, along with the private key that belongs to it. The key, the request and the certificate are built with the WebCrypto API and encoded as standard PEM, so they open in openssl, nginx, Apache, Node, and every language’s TLS library.

What a CSR contains

A PKCS#10 certificate signing request has three parts: the subject (who the certificate is for), the public key, and a signature made with the matching private key. The signature proves to the CA that whoever submitted the request also holds the private key. Extensions requested by the applicant, such as subject alternative names, travel inside an attribute called extensionRequest.

The CA copies what it accepts from the request into the certificate it issues. Public CAs ignore most of the subject (they verify the domain, not your organization name) and read the hostnames from the SAN list, so the SAN field is the part worth getting right.

Subject vs subject alternative names

The subject fields (CN, O, OU, L, ST, C, email) are human-readable labels. The subject alternative name extension is what a browser or TLS client matches against the hostname it connected to. Chrome stopped reading the common name for hostname matching in version 58 (Chromium blog, 2017), and Firefox and Safari behave the same way. A certificate with CN=localhost and no SAN fails in every current browser.

The SAN field takes a comma-separated list. localhost, 127.0.0.1, ::1, *.dev.test becomes two IP entries and two DNS entries; the hint under the field shows how each item was read. A wildcard such as *.dev.test covers one label, so it matches api.dev.test but not a.b.dev.test. Entries that are neither a hostname nor an IP are dropped rather than written into the file.

Choosing the key

Key Size When
ECDSA P-256 256-bit curve The default. Smallest key, fastest handshake, universal support.
ECDSA P-384 384-bit curve Policies that require 192-bit security strength.
RSA 2048 2048-bit modulus Older appliances, Java keystores, or anything that rejects EC keys.
RSA 3072 3072-bit modulus RSA where 2048 is considered too short for the certificate’s lifetime.
RSA 4096 4096-bit modulus Rarely needed; generation takes several seconds and every handshake does more work.

The signature hash defaults to SHA-256. SHA-384 is the conventional pairing for P-384. SHA-1 is not offered: browsers have rejected SHA-1 signatures since 2017.

Self-signed certificates for local HTTPS

Switch to Self-signed to skip the CA. The certificate is signed with its own key, the issuer equals the subject, and it carries basicConstraints, keyUsage and extendedKeyUsage set for a TLS server (serverAuth and clientAuth). Set the validity in days; browsers reject certificates that last longer than 398 days when a public CA issues them, and Safari applies the same limit to certificates trusted through the system store, so 365 is a safe value for a development machine.

Browsers warn about a self-signed certificate because its issuer is not in any trust store. To silence the warning on your own machine, import cert.pem into the system or browser trust store as a trusted root, or tick Certificate authority to mint a local CA and sign server certificates with it using openssl.

The equivalent openssl command

The command pane shows the single openssl req invocation that produces the same output from the same settings:

openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes \
  -keyout key.pem -sha256 -x509 -days 365 -out cert.pem \
  -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"

Drop -x509 -days 365 and change -out to csr.pem for a request instead of a certificate. The -addext flag needs OpenSSL 1.1.1 or later; older releases read the extension from a config file instead.

Decode and convert

The Decode / JWK mode reads one PEM block and reports what is inside: subject and issuer, serial number, validity window and whether it has passed, key algorithm and size, the CA flag, SAN list and SHA-256 fingerprint. A certificate request is verified against its own signature. The key inside is exported as a JSON Web Key for JWT libraries and JWKS endpoints, and the raw DER bytes are shown as Base64 and as hex for comparing with another copy of the file.

Limits

  • The output is a request or a self-signed certificate, never a CA-issued one. Send the CSR to a CA for that.
  • No PKCS#12 (.pfx) bundles. Combine the key and certificate with openssl pkcs12 -export when a Windows or Java server needs one.
  • Legacy RSA PRIVATE KEY and EC PRIVATE KEY blocks and encrypted keys are not decoded. Convert them to PKCS#8 with openssl pkey first.
  • Keep key.pem. The CSR and certificate are useless without the private key they were made from, and the key is not stored anywhere once the page is closed.

Frequently Asked Questions

A fresh private key in PKCS#8 PEM, the matching public key, and either a PKCS#10 certificate signing request or a self-signed X.509 v3 certificate. Each file has its own copy and download button, and a decoded summary shows the subject, names, key type, serial, validity and SHA-256 fingerprint.

ECDSA P-256 for anything new: it signs faster, the key is 10 times smaller than RSA 2048, and every current browser and TLS library accepts it. Choose RSA 2048 or 3072 when the receiving system is older or a policy names RSA. RSA 4096 takes several seconds to generate.

A browser trusts a certificate only when its issuer chains to a root in the system or browser trust store. A self-signed certificate is its own issuer, so the chain ends at an unknown root. Import the certificate into the trust store on the development machine, or sign it with a local CA such as mkcert, to remove the warning.

Not for hostname matching. Chrome stopped reading the CN in version 58 and every other browser followed, so the names a browser checks are the DNS and IP entries in the subject alternative name extension. Keep the CN as a readable label and put every hostname and address in the SAN field.

Yes. The Decode / JWK mode reads a PEM certificate, certificate request, public key or PKCS#8 private key, prints the decoded fields, converts the key to a JSON Web Key, and shows the DER bytes as Base64 and hex. Legacy RSA PRIVATE KEY and EC PRIVATE KEY blocks and encrypted keys are not read; the error names the openssl command that converts them.

No. A CA-signed certificate comes from the CA after you submit the CSR to it. Generate the request here, keep the private key, send only the CSR, and install the certificate the CA returns next to that key.

Explore Our Tools

Browse all tools