ASCII तालिका

128 ASCII वर्णों का पूर्ण संदर्भ दशमलव, हेक्स, अष्टाधारी और बाइनरी कोड के साथ।

128 वर्ण दिखाए गए

ASCII के बारे में

ASCII (American Standard Code for Information Interchange) सूचना विनिमय के लिए अमेरिकी मानक कोड, एक वर्ण एन्कोडिंग मानक है।

वर्ण श्रेणियाँ

ASCII और Unicode में क्या अंतर है?

ASCII 7 बिट्स पर 128 वर्णों को परिभाषित करता है। Unicode एक सुपरसेट है जो सभी लेखन प्रणालियों से 149,000+ वर्णों को कवर करता है। पहले 128 Unicode कोड पॉइंट ASCII के समान हैं।

मैं इन कोड्स को प्रोग्रामिंग में कैसे उपयोग करूँ?

JavaScript में: String.fromCharCode(65) → «A»। Python में: chr(65)। C में: (char)65। हेक्स मान एस्केप अनुक्रमों के साथ काम करते हैं: \x41 = «A»।

How It Works

  1. Browse the full table: all 128 ASCII characters appear in a grid sorted by code point (0 through 127). Each cell shows the visible character (or its abbreviation for control codes), the decimal code, and the hex / octal / binary equivalents.
  2. Filter by category: use the dropdown to narrow to control characters (0–31), printable characters (32–126), letters, digits, or symbols. Useful when you only care about, say, the punctuation block.
  3. Search: the search box matches by character name ("LF"), abbreviation, or numeric value (decimal or hex). Typing 0x41, 65, or A all jump to the same cell.
  4. Click a cell to copy any of its representations to the clipboard. Handy when you need \x1B for an ANSI escape, 0x0A for a Unix newline, or the decimal 32 for a space.

A Brief History of ASCII

ASCII (American Standard Code for Information Interchange) was proposed by IBM engineer Bob Bemer to the American Standards Association's X3.2 subcommittee in May 1961, with the goal of replacing the dozen incompatible character codes then in use. The first published edition was ASA X3.4-1963; lowercase letters did not arrive until the 1967 revision. The standard has been reaffirmed multiple times since then under the name ANSI X3.4-1986, and it forms the base of every modern character encoding through its international twin, ISO/IEC 646 (and the European ECMA-6).

For network use, ASCII was codified by RFC 20, "ASCII format for Network Interchange," published on 16 October 1969 and authored by Vint Cerf at UCLA. The RFC's recommendation ("7-bit ASCII embedded in an 8-bit byte whose high-order bit is always 0") is still the way every modern programming language and protocol thinks about plain text. The US Federal Government, by executive order from President Lyndon B. Johnson in 1968, mandated ASCII support on all federal computers from 1 July 1969 onward, which guaranteed industry-wide adoption.

Why Seven Bits?

The X3.2 committee was caught between two unattractive options. A 6-bit code (used by older telegraph alphabets like ITA2) was unreliable: a single bit-flip on a noisy line could mis-decode every following character if it happened to land on a shift bit. An 8-bit code seemed wasteful in an era of expensive memory and slow modems. The compromise was 7 bits = 128 code points, leaving the 8th bit free for parity. Setting the parity bit so that every byte had an even (or odd) total number of 1-bits caught 100% of single-bit transmission errors, exactly the problem that 1960s acoustic couplers and serial cables produced.

As error rates dropped and modems got faster, the 8th bit was repurposed. Various national "extended ASCII" code pages (Latin-1, Windows-1252, Mac Roman, KOI8-R, …) used codes 128–255 for accented letters and box-drawing characters, but those mappings were mutually incompatible and were eventually displaced by Unicode and UTF-8.

The Layout: 128 Code Points

7 bits = 27 = 128 distinct codes, organised as 33 control characters (0–31 plus DEL at 127) and 95 printable characters (32–126):

RangeHexContents
0–3100–1FControl characters (NUL, BEL, BS, HT, LF, CR, ESC, FS-US, …)
3220SPACE, printable but invisible
33–4721–2FPunctuation: ! " # $ % & ' ( ) * + , - . /
48–5730–39Digits 0–9
58–643A–40More punctuation: : ; < = > ? @
65–9041–5AUppercase A–Z
91–965B–60Brackets and accents: [ \ ] ^ _ `
97–12261–7ALowercase a–z
123–1267B–7ECurly braces and tilde: { | } ~
1277FDEL, "rub out" on punched paper tape (binary 1111111)

Control Characters That Still Matter

Most of the 33 control characters originated as teletype and paper-tape commands and are now historical curiosities. A handful are still load-bearing in everyday computing:

The Line-Ending Wars

Three platforms picked three different conventions, and software has been paying for it ever since. The mechanical origin is the typewriter and teletype, where two separate actions were needed: carriage return moved the print head back to column 1, and line feed advanced the paper by one line. Different systems made different decisions about whether to encode this as one byte or two:

OSNewlineBytesEscape
Unix / Linux / modern macOSLF0x0A\n
Classic Mac OS (pre-OS X)CR0x0D\r
Windows / DOSCRLF0x0D 0x0A\r\n

Internet protocols mostly mandate CRLF: HTTP, SMTP, FTP, MIME, and the standard Internet Message Format all specify it. RFC 5322 is unambiguous: "CR and LF MUST only occur together as CRLF; they MUST NOT appear independently" in the message body. Inside source code, however, the convention varies by team, which is why git ships core.autocrlf: with true on Windows, git checks files out as CRLF in the working tree but stores them as LF in the repo, so the same source file produces the same blob hash on every platform. A .gitattributes entry like * text=auto is the project-level alternative.

ANSI Escape Sequences for Terminal Colour

The escape character (ESC, 0x1B) is the prefix for the ANSI escape sequences that colourise terminal output. The standard is ECMA-48 (1976), later mirrored as ANSI X3.64 and folded into ISO/IEC 6429. The grammar is ESC [ + parameters + a final letter; the ESC [ part is called the Control Sequence Introducer (CSI) and is written variously as \e[, \x1b[, or \033[ depending on the language. Common Select Graphic Rendition codes:

So printf '\033[1;31mERROR\033[0m' prints "ERROR" in bold red and resets afterward. Every modern terminal emulator (and the Windows Terminal since 2019) supports these.

ASCII vs Unicode and UTF-8

ASCII defines 128 code points; Unicode 16.0 (released 2024) covers more than 154,000. The crucial bridge is UTF-8, the dominant text encoding on the web (used by ~98% of websites in 2026): UTF-8 is designed so that any 7-bit ASCII byte (0x000x7F) encodes the same character it always did, with the high bit zero. The practical consequence is that every valid ASCII file is also a valid UTF-8 file, byte-for-byte identical. Codepoints above 127 are encoded as multi-byte sequences (2 to 4 bytes) with the high bit set on every byte, which guarantees that legacy ASCII parsers never confuse them for ASCII characters.

ASCII in Common Programming Languages

LanguageCode → characterCharacter → code
JavaScriptString.fromCharCode(65)'A'.charCodeAt(0)
Pythonchr(65)ord('A')
C / C++(char)65(int)'A'
Java(char) 65(int) 'A'
Rustchar::from(65)'A' as u32
Gostring(rune(65))int('A')
Bash / shprintf '\x41'printf '%d' "'A"
HTML&#65; or &#x41;-
URL encoding%41 = "A", %20 = space-

The Case-Bit Trick

A small but elegant property of the ASCII layout: an uppercase letter and its lowercase counterpart differ in exactly one bit. A is 65 = 0100 0001; a is 97 = 0110 0001. Only bit 5 differs. That makes case-insensitive comparison a single bitwise operation, x | 0x20 forces lowercase, x & 0xDF forces uppercase, both faster than a lookup table. This was a deliberate design choice in the 1967 revision and is one reason the layout looks "random" in places: it encodes hardware-friendly properties, not just alphabetical order.

Common Pitfalls

  1. Confusing the digit 0 with the NUL control character. NUL is code 0; the character "0" is code 48. The two are not interchangeable in any programming language.
  2. Assuming a byte is a character. Only true for ASCII text. UTF-8 text has variable-width characters, so byte length and character count can differ wildly for non-Latin scripts.
  3. Mixing line endings inside one file. Mixed CR / LF / CRLF inside the same file confuses many parsers and produces phantom blank lines or missing newlines depending on which OS opens it.
  4. Off-by-one in C string termination. Forgetting that strings need an extra byte for the trailing NUL is the original buffer-overflow vulnerability.
  5. "Extended ASCII" assumed to be portable. Codes 128–255 mean different characters under Latin-1, Windows-1252, KOI8-R, Mac Roman, etc. UTF-8 is the only safe modern choice.
  6. Embedded ESC in untrusted input. If you log user-supplied data to a terminal without sanitising it, an attacker can inject ANSI escape sequences that change colour, move the cursor, or clear the screen, sometimes hiding malicious content.

Frequently Asked Questions

Why does DEL have code 127 instead of 0?

Because 127 in binary is 1111111: all seven bits set. To delete a character on punched paper tape, the operator backed the tape up and pressed RUB OUT, which punched through every existing hole. The receiver was supposed to ignore any byte that was all-1s, so the "deleted" character became invisible on subsequent reads. The convention was inherited from earlier teletype codes.

What is "extended ASCII" and is it safe to use?

Standard ASCII covers code points 0–127 (7 bits). "Extended ASCII" loosely refers to 8-bit encodings that fill code points 128–255 with additional characters, Latin-1, Windows-1252, KOI8-R, Mac Roman, and many others. The catch: the extra characters mean different things in each encoding. The name is technically a misnomer (those code pages are not extensions of the ASCII standard), and they are not safe across systems. UTF-8 is the modern, portable replacement and is backwards-compatible with the original 0–127 range.

Why is space (32) considered "printable" if it doesn't show anything?

Because it occupies horizontal space on a printed line, it advances the print head exactly the way a letter does. Control characters by contrast change device state without producing visible output (BEL beeps, BS moves the head backwards, LF advances paper). The classification is based on what the character does on a printer, not on whether it has a glyph.

Are CR and LF the same as Enter on my keyboard?

Mostly yes, but the byte your keyboard generates depends on the OS. On Windows, pressing Enter typically produces CRLF (0x0D 0x0A); on Linux and modern macOS, just LF (0x0A); on classic Mac OS pre-X, just CR (0x0D). Many editors normalise this on save based on the file's existing line endings or the configured project convention.

Why are the file/group/record/unit separators in here?

They were designed for record-oriented tape storage in the 1960s, File > Group > Record > Unit. They mostly fell out of use, but they have come back in two surprising places: RFC 7464 "JSON Text Sequences" (media type application/json-seq) uses RS (0x1E) as a prefix to delimit streamed JSON records, and the GS1 Application Identifier separator in retail barcode protocols uses GS (0x1D).

Is ASCII still relevant in 2026?

Very. Every modern protocol that is "text-based" (HTTP headers, JSON, YAML, source code, command-line arguments, environment variables, DNS hostnames) operates within the ASCII range. UTF-8 is the dominant encoding for arbitrary text, but UTF-8's first 128 byte values are exactly ASCII, byte-for-byte. Knowing the table is still required for anything from URL encoding to terminal colour to debugging text-encoding bugs.

संबंधित टूल

बाइनरी से पाठ संख्या आधार कनवर्टर HTML एंटिटी एन्कोडर