How to type ] (Right square bracket)

On macOS, U.S. keyboard:

]

See the animated keys

] on every keyboard

SystemLayoutKey combination
macOS French – Numerical ⌥ Option+⇧ Shift+)
macOS French ⌥ Option+⇧ Shift+)
macOS Belgian ⌥ Option+⇧ Shift+)
macOS Swiss French ⌥ Option+6
macOS Canadian Multilingual (CSA) ⌥ Option+0
macOS Canadian French ]
macOS Spanish ⌥ Option++
macOS Latin American ⇧ Shift+}
macOS U.S. ]
macOS ABC ]
macOS U.S. International – PC ]

What is the right square bracket for?

The right square bracket ] closes what Left square bracket [ opened: a list, an index, a Markdown link or an editorial insertion.

primes = [2, 3, 5, 7]
print(primes[-1])

Common uses:

  • the end of an array or list in code;
  • the end of link text in Markdown: [documentation](/docs);
  • the end of a character class in a regular expression: [0-9];
  • the end of an editorial note: [sic], […].

Pitfalls

  • A missing bracket is a classic syntax error: code editors highlight the matching pair.
  • Its position varies a lot between layouts: ] here, ⌥ Option+⇧ Shift+) on French – Numerical.

] technical details

Unicode code pointU+005D
Official Unicode nameRIGHT SQUARE BRACKET
HTML entity]
CSScontent: "\5D";
JavaScript / JSON"\u005D"
UTF-8 bytes5D
URL encoding%5D

The official name comes from the Unicode Character Database (ICU).

Related characters