Skip to content
YAS.SH
Security🔒 Browser (client-side)API available📴 Works offlineadvanced

PEM Certificate Converter

Converts between PEM text armor, binary DER format, and extracts X.509 certificate headers and key details.

Data stays in your browser
Ready to runInstant execution
All tools →
Result

What does this tool do?

Converts between PEM text armor, binary DER format, and extracts X.509 certificate headers and key details.

Why would I use it?

  • You need to convert an SSL/TLS certificate between PEM (.crt, .pem) and binary DER (.cer, .der) for Java or Windows servers.
  • You want to extract the base64 DER payload from a PEM container.
  • You are inspecting certificate boundaries and public key types.

Real-life example

Input
-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A...\n-----END CERTIFICATE-----
Output
Type: CERTIFICATE · Byte Length: 294 bytes · Hex: 30820122300d0609...

Parses ASN.1 DER structure and base64 container.

Input → Process → Output → Next

Input
Paste PEM certificate, private key, or public key text.
Process
Strips headers/trailers, decodes base64 payload, and converts to raw binary DER hex.
Output
Decoded DER representation, byte length, and certificate classification.
Next action
Import the certificate into your web server, keystore, or TLS configuration.

Common mistakes

  • Mixing private keys and public certificates in the same file without clear boundaries.
  • Modifying base64 whitespace inside the PEM container.
  • Using wrong header tags (e.g. RSA PRIVATE KEY vs PRIVATE KEY).

What the result means

A standardized translation between armored ASCII PEM and binary ASN.1 DER encoding.

Privacy & security

Your input is processed entirely in your browser and never sent to a YAS server.

API

Endpoint
POST https://yas.sh/api/v1/tools/pem-converter
Request Header
Content-Type: application/json
cURL
curl -X POST "https://yas.sh/api/v1/tools/pem-converter" \
  -H "Content-Type: application/json" \
  -d '{"input":"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"}'
JavaScript
const res = await fetch("https://yas.sh/api/v1/tools/pem-converter", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "input": "-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"
}),
});
const data = await res.json();
Python
import requests

r = requests.post("https://yas.sh/api/v1/tools/pem-converter", json={"input":"-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----"})
data = r.json()
FieldTypeRequiredDescription
inputstringYesPEM certificate text
Success response
{ "slug": "pem-converter", "type": "CERTIFICATE", "byteLength": 240 }

Convert between PEM text armor and base64 DER binary format.

Error responses
  • 400 VALIDATION_ERROR — invalid input or unsupported option.
  • 413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.
  • 429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).
Limits
  • Maximum input: 64 KB per request.
  • Rate limit: 60 requests/min per IP address.
  • Authenticated accounts benefit from higher tier quotas.
Ask YAS AI
🍪 Cookies & privacy. Essential cookies keep you signed in and remember language and theme. Google AdSense and reCAPTCHA are Google technologies: AdSense runs only after Accept All; reCAPTCHA loads on sign-in and contact forms. See how Google uses data: https://policies.google.com/technologies/partner-sites cookie policy · privacy policy.
Settings