What is a CRT file?
A file with .crt extension is a security certificate file that is used by secure websites for establishing secure connections from web server to a browser. Secure websites make it possible to secure data transfers, logins, payment card transactions, and provide protected browsing to the site. If you open a secure website, you see a “lock” icon in the address bar. If you click on it, you can view the details of the installed certificate. International companies such as Verisign and Thawte distribute these SSL certificates.
CRT File Format
CRT files are in ASCII format and can be opened in any text editor to view the contents of the certificate file. It follows the X.509 certification standard that defines the structure of the certificate. It defines the data fields that should be included in the SSL certificate. CRT belongs to the PEM format of certificates that are Base64 ASCII encoded files.
PEM File Structure
A PEM file can have multiple certificates. In such a case, each certificate in the PEM file follows the following structure.
---- BEGIN CERTIFICATE----
...
...
...
Encoded string for encryption of data
...
...
...
----END CERTIFICATE----
CRT File Format Example
---- BEGIN CERTIFICATE----
MIICUDCCAdoCBDaM1tYwDQYJKoZIhvcNAQEEBQAwgY8xCzAJBgNVBAYTAlVTMRMwMIICCDAaBgkqhkiG9w0BBQMwDQQIIfYyAEFKaEECAQUEggHozdmgGz7zbC1mcJ2rcNAQEEBQAwgY8xCzAJBgNVBAYTAlVTMRMwMIICCDAaBgkqhkiG9lVTMRMwMIICCDAaBgkqhkiG9w0BBQMwDQQIIfYwDQYJKoZIhvcNAQEEBQAwgY8xCzAkiG9w0BBQMwDQQIIfYyAEFKaEECAQUEggHozdmgGz7wgY8xCzAJBgNVBAYTAlVTMRMwMIICCDAaBgkqhkiG9w0BBQMwDQQIIfYyAEFKaEECAQUEggHozdmgGz7zbC1mcJ2rcNAQEEBQAwgY8xCzAJBgNVBAYTAlVTMR
----END CERTIFICATE----
CRT vs. CER: The Great Extension Debate
One of the most persistent sources of confusion in certificate management is the difference between .crt and .cer files. The short answer: technically, there is no meaningful difference .
Both extensions store X.509 certificates. Both can be PEM-format (text) or DER-format (binary). The choice of extension is largely a matter of convention and platform preference:
- .crt is commonly associated with Unix, Linux, and Apache-based systems
- .cer is frequently used on Microsoft Windows platforms and by certificate authorities when distributing certificates
A .cer file on Windows might be in binary DER format, while a .crt file on Linux is almost certainly text-based PEM. But these are conventions, not rules. You can freely rename a .crt file to .cer and vice versa—the content determines the format, not the extension .
The only practical distinction is that Windows recognizes .cer as a certificate file type and provides special handling (double-clicking opens the certificate dialog), while .crt files on Windows might open in Notepad unless you’ve set associations.
Key Characteristics of the CRT File Format
| Characteristic | Description |
|---|---|
| Extension | .crt (security certificates), also .pem, .cer |
| Standard | X.509 (ITU-T standard) |
| Encoding | Typically PEM (Base64 ASCII), also DER (binary) |
| Format Family | PEM, PKCS#7, PKCS#12 (when bundled with private key) |
| Human Readable | Yes, when PEM-encoded; No, when DER-encoded |
| Contains Private Key | No—private keys are separate .key files |
| Multiple Certificates | Yes, PEM files can contain certificate chains |
FAQ
Q1: Can I open a CRT file in a web browser?
A: You don’t open CRT files in browsers directly. You install them on a web server, and browsers automatically validate them when you visit the secured website. However, on Windows, double-clicking a .cer file opens the certificate viewer dialog.
Q2: AIs a CRT file the same as an SSL certificate?
A: Yes, a CRT file is the container format for an SSL/TLS certificate. The certificate itself is the structured data inside the file; CRT is simply one of several possible file extensions for storing that data.
Q3: Why does my CRT file show garbled text when I open it?
A: You’re viewing a DER-encoded (binary) certificate in a text editor. DER files are not human-readable. You can either convert it to PEM using OpenSSL or use a certificate viewer application.
Q4: What’s the difference between CRT and PEM files?
A: In practice, almost nothing. CRT files are typically PEM-formatted. Sometimes .pem extensions are used for any PEM-encoded crypto material (certificates, keys, CSRs), while .crt is specifically used for certificates.
Q5: Can I convert a CRT file to PFX?
A: Yes, but you need the corresponding private key. Use: openssl pkcs12 -export -in certificate.crt -inkey private.key -out certificate.pfx. You’ll be prompted to set an export password.