Skip to content

JSP (.jsp)

.jsp file signature | text/x-jsp

Safe

Magic Bytes

Offset 0
3C 25 40

Sources: Apache Tika

All Known Signatures

2 signature variants are documented for .jsp files across multiple sources.

Hex Signature Offset Sources
3C 25 40 0 Apache Tika
3C 25 2D 2D 0 Apache Tika

Extension

.jsp

MIME Type

text/x-jsp

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .jsp files in Python

Python
def is_jsp(file_path: str) -> bool:
    """Check if file is a valid JSP by magic bytes."""
    signature = bytes([0x3C, 0x25, 0x40])
    with open(file_path, "rb") as f:
        return f.read(3) == signature

How to validate .jsp files in Node.js

Node.js
function isJSP(buffer: Buffer): boolean {
  const signature = Buffer.from([0x3C, 0x25, 0x40]);
  return buffer.subarray(0, 3).equals(signature);
}

How to validate .jsp files in Go

Go
func IsJSP(data []byte) bool {
    signature := []byte{0x3C, 0x25, 0x40}
    if len(data) < 3 {
        return false
    }
    return bytes.Equal(data[:3], signature)
}

API Endpoint

GET /api/v1/jsp
curl https://filesignature.org/api/v1/jsp

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .jsp file?

A .jsp file is a JSP file.

What are the magic bytes for .jsp files?

The magic bytes for JSP files are 3C 25 40 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .jsp file?

To validate a .jsp file, read the first bytes of the file and compare them against the known magic bytes (3C 25 40) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .jsp files?

The primary MIME type for .jsp files is text/x-jsp.

Is it safe to open .jsp files?

JSP (.jsp) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.