Back
Asciify Logo
Asciify

Left Square Bracket

[ (Left Square Bracket) is ASCII code point 91 (0x5B), Unicode U+005B, and a printable punctuation character. It opens a bracketed enclosure — in prose, it typically marks editorial insertions or clarifications within quoted text, signaling that the words inside came from someone other than the original speaker. Programming made square brackets the universal indexing operator. array[0] retrieves the first element in C, Python, JavaScript, Java, Ruby, and nearly every language that supports random access. Python extends the notation into slicing (list[1:4]), and JavaScript uses brackets for dynamic property access (obj["key"]) when dot notation won't work — particularly when the key contains spaces or is stored in a variable. In regular expressions, [abc] defines a character class, matching any single character from the set inside. JSON uses [ to open arrays, and Bash leans on [ as a synonym for the test command in conditionals. The trap is subtle and language-specific: in C, array indexing performs no bounds checking, so array[10] on a five-element array doesn't raise an error — it silently reads whatever garbage happens to occupy that memory address, producing results that change between runs and vanish under a debugger. Square brackets entered typographic use around the seventeenth century, introduced by printers who needed a visual distinction from the already-established parentheses to denote a different kind of enclosure. UTF-8 encodes it as a single byte 0x5B. Unicode classifies it as Ps (Punctuation, Open) with the name LEFT SQUARE BRACKET. Its closing partner ] sits at U+005D, and the fullwidth [ (U+FF3B) appears in CJK text — a wider glyph that will quietly break any parser expecting the ASCII original.

Symbol

Technical Details

Code Example

</>
char s[] = "[OK]";
char tag = s[0]; // '[' at the start
s[0] = '('; // edit by indexing
/* s is now "(OK]" */

Frequently Asked Questions

  • Square brackets serve three main purposes: array indexing (arr[0]), array/list creation ([1, 2, 3] in Python/JavaScript), and computed property access (obj['key']). In regex, [abc] defines a character class. In Bash, [ is actually a command (test) with ] as its closing argument.

  • In CLI documentation and man pages, [optional] means the argument is optional. In BNF grammar notation, they indicate optional elements. In Markdown, [text](url) creates a link. In JSON Schema, they define array types. The convention of 'brackets = optional' is nearly universal.

  • In Bash, [ is literally /usr/bin/[ (or a shell builtin) — it's the 'test' command that evaluates conditional expressions. The ] is just a required final argument. This is why spaces are mandatory: [ -f file ] works, but [-f file] fails because 'test' needs its arguments separated.

  • [abc] matches any single character in the set (a, b, or c). [^abc] matches any character NOT in the set. [a-z] matches any lowercase letter. Inside brackets, most metacharacters lose their special meaning — . is a literal dot, not 'any character.' Only ^, -, ], and \ are special inside [ ].

@workani&@alexluthor
Privacy & legal

Privacy

No accounts, no ads, no tracking cookies, and no cross-site tracking. The only analytics we keep are faceless — anonymous, aggregated counts of pages and searches, never tied to you. We store no IP addresses, set no tracking cookies, and build no profiles. Cloudflare hosts the site and handles requests for delivery and security.

Full privacy policy·Extension privacy·legal@asciify.dev

Attributions & licenses

Twemoji
© Twitter, Inc and other contributors · CC-BY 4.0
Noto Color Emoji
© Google · Apache 2.0
Fluent UI Emoji
© Microsoft · MIT
OpenMoji
© HfG Schwäbisch Gmünd · CC-BY-SA 4.0
Toss Face
© Viva Republica (Toss) · SIL OFL 1.1
JoyPixels
© JoyPixels Inc. · Free Limited Use License
SerenityOS Emoji
© The SerenityOS Developers · BSD-2-Clause
EmojiTwo
© EmojiTwo contributors · CC-BY 4.0
Apple Color Emoji
© Apple, Inc.
Facebook Emoji
© Meta Platforms, Inc.

Apple and Facebook emoji styles are proprietary and shown here solely for reference and comparison — a common-sense application of nominative-use / fair-use principles. asciify is not affiliated with, endorsed by, or sponsored by Apple, Inc., Meta Platforms, Inc., or any other rights holder listed above. If a rights holder requests removal of their emoji style from this site, it will be removed.

All other vendor emoji are reproduced for reference and comparison under their respective open licenses listed above.

Character names and code points from the Unicode® Standard. Unicode® and the Unicode Logo are registered trademarks of Unicode, Inc.

Privacy
© asciify.dev 2025-2026