Files ending in .crt, .cer, and .pem are typically PEM encoded. If the file contains a -----BEGIN CERTIFICATE----- header, then it confirms the PEM encoding.
If you’re using OpenSSL 3.X or earlier and have a DER-encoded .crt, you may need to add -inform DER to the command.