Character Encoding Detector

Reports the UTF-8 byte length of entered text, a leading BOM character, and whether the text contains a NUL character. It cannot detect the original encoding of already-decoded pasted text.

Encoding Detector · Client runtimeSandboxed
Formatted results will render here in real time.

About this character encoding detector

Reports the UTF-8 byte length of entered text, a leading BOM character, and whether the text contains a NUL character. It cannot detect the original encoding of already-decoded pasted text Transforms and validates developer data structures locally, preventing confidential payload exposure during data wrangling.

Syntax parsing & data transformation logic

Provides standards-compliant encoding, decoding, and unique identifier generation covering POSIX Unix epoch timestamps, ISO 8601 / RFC 3339 extended calendar formats, RFC 4122 Universally Unique Identifiers (UUIDv4 pseudorandom, UUIDv7 millisecond time-ordered), ULID (Universally Unique Lexicographically Sortable Identifier), and W3C HTML5 entity character references. Timestamp conversions utilize high-precision integer arithmetic to prevent 32-bit Year 2038 signed rollover bugs, while UUID generation taps directly into the browser's cryptographically secure pseudo-random number generator (CSPRNG, crypto.getRandomValues).

Worked conversion & output example

Scenario: Inspect a pasted Unicode string after UTF-8 re-encoding; original file encoding is unavailable.

Sample input:

CZOA

Processing: Encode pasted text to UTF-8, count bytes, and inspect leading U+FEFF and NUL characters. This does not identify legacy file encoding.

Illustrative output:

{ "encoding": "UTF-8", "hasBom": false, "byteLength": 4, "confidence": "high" }

Syntax constraints & input size limits

It cannot recover the original encoding of pasted text or inspect raw file bytes. “UTF-8” and confidence are labels for the re-encoded text and simple markers, not statistical charset detection.

Data conversions and formatting in Character Encoding Detector reflect standard structured syntax. Verify parsed outputs against your target runtime before deployment.

Local client execution boundary

Data parsing and transformations in Character Encoding Detector execute in the local browser tab without remote data transmission.

Data format specifications & language standards

Data interchange formats and language grammar specifications:

  • Standard Browser Web API / Algorithm Implementation (No single external RFC/ISO standard)

Character Encoding Detector verification · Audit standards

How to use it

  1. Paste text that the browser has already decoded.
  2. Re-encode it as UTF-8, check a leading BOM character and NUL bytes, and measure byte length.
  3. Read the heuristic encoding label, confidence, BOM flag and byte length as JSON.

Frequently asked questions

What does Encoding Detector inspect?+

It encodes entered JavaScript text with TextEncoder, reports UTF-8 unless the string starts with a BOM or the encoded bytes contain NUL, and returns byteLength plus a high or low confidence label.

What does the current CZOA example report?+

CZOA reports UTF-8, hasBom false, byteLength 4, and high confidence. Four is its UTF-8 byte length, not a source file size or proof of the original encoding.

How are BOM and NUL handled?+

A leading U+FEFF is labeled UTF-8 BOM. A NUL byte in the TextEncoder output instead yields binary or UTF-16-like data with low confidence; no actual UTF-16 decoding is attempted.

What is outside the detector scope?+

It does not inspect a file upload, statistically distinguish encodings, detect language, transcode bytes, repair mojibake, or guarantee the original producer used UTF-8.