! (Exclamation Mark) is ASCII code point 33 (0x21), Unicode U+0021, and a printable punctuation character. It marks emphasis or exclamatory tone in written language — the typographic equivalent of raising your voice. In programming it lives a double life as the logical NOT operator: !true evaluates to false in C, C++, Java, JavaScript, and most C-family languages. It also appears in != (not equal), CSS's !important, and the Unix shebang line #!/bin/bash that tells the kernel which interpreter to run a script with. In Bash, ! also triggers history expansion — typing !rm in an interactive shell reruns the last command starting with "rm," which catches developers off guard when they meant it literally. Early typewriters sometimes lacked a dedicated ! key — typists would type a period, backspace, and strike an apostrophe over it. UTF-8 encodes it as a single byte 0x21, identical to its ASCII value. Unicode classifies it as Po (Punctuation, Other) with the name EXCLAMATION MARK.
int ok = (value != 0);int blocked = !ok; // logical NOTif (!ptr) return -1; // null-check uses '!'int changed = (a != b); // '!=' includes '!'
The nickname 'bang' comes from typesetting and Unix culture. In shells, ! triggers history expansion (e.g., !! repeats the last command). The #! at the start of scripts is called a 'shebang' (shell + bang). The name stuck because it's faster to say than 'exclamation mark.'
In most C-like languages (C, Java, JavaScript), ! is logical NOT — it flips true to false. In Rust and TypeScript, ! also appears in types (never!) and macros (println!). In CSS, !important overrides specificity. In Git, ! in .gitignore negates a pattern.
Bash uses ! for history expansion — !$ means the last argument, !! means the last command. Inside double quotes, ! is still interpreted, which breaks strings containing it. Use single quotes or \! to include a literal exclamation mark.
!= means 'not equal' in most languages. In JavaScript, != does type coercion (so '5' != 5 is false), while !== is strict comparison without coercion ('5' !== 5 is true). Python and C only have !=, which behaves like strict comparison.