How to Identify a Lock Symbol in Unicode
Find out which Unicode character a lock symbol really is: read its code point and official name, catch hidden variation selectors and spot icon-font lookalikes.
A padlock in a document, chat message or web page can be one of several different Unicode characters. It can also be no standard character at all. To copy, search for, replace or encode it reliably, you need its code point, which is the unique number Unicode assigns to each character, written as U+ followed by hexadecimal digits. This guide shows how to find that number, how to read the result, and how to confirm you have the right character without changing the surrounding text.
What a Unicode inspector does with your text
A Unicode inspector, sometimes called a character identifier or code point viewer, takes a piece of text and splits it into individual characters. For each character it reports the code point and the official Unicode name. Many inspectors also report the Unicode block (the range the character belongs to) and the byte encoding in UTF-8 or UTF-16. Inspection is read-only, so the input text is not modified. Its main value is that it shows characters you cannot see, such as variation selectors that control whether a lock appears as a colorful emoji or as a plain text symbol.
Scope matters here. An inspector identifies the characters actually stored in the text. It cannot tell you which font or platform drew a particular image, and it cannot identify a lock that is an image, an SVG graphic or a CSS background rather than text.
Standard lock-related characters
These are the lock and key characters defined in the Unicode Standard, listed with their official names. The glyph you see depends on your font and platform.
| Character | Code point | Official name |
| 🔒 | U+1F512 | LOCK |
| 🔓 | U+1F513 | OPEN LOCK |
| 🔐 | U+1F510 | CLOSED LOCK WITH KEY |
| 🔏 | U+1F50F | LOCK WITH INK PEN |
| 🔑 | U+1F511 | KEY |
| 🗝 | U+1F5DD | OLD KEY |
| ⚿ | U+26BF | SQUARED KEY |
The four padlock characters are in the Miscellaneous Symbols and Pictographs block. Their code points are above U+FFFF, which affects how some programming languages count them (see the verification section).
Step-by-step: identifying a lock symbol
- 1. Copy only the symbol, or a short snippet that contains it, from the source. Copy from the original text, not from a screenshot.
- 2. Paste it into a Unicode inspector or character identifier, or run one of the short scripts below.
- 3. Read every line of the output, not just the first. One visible lock may be made of more than one code point.
- 4. Compare the code point and name against the table above.
- 5. Check for U+FE0F (VARIATION SELECTOR-16) or U+FE0E (VARIATION SELECTOR-15) directly after the lock. U+FE0F requests emoji-style display and U+FE0E requests text-style display.
- 6. If the code point falls between U+E000 and U+F8FF, it is in the Private Use Area. That is not a standard lock character (see below).
Inspecting the symbol with a short script
If you prefer not to paste text into an online tool, Python's standard library can list the code point and name of each character. The snippet below is an example. Paste your own text between the quotes.
import unicodedata
text = "🔒" # paste the symbol here
for ch in text:
print(f"U+{ord(ch):04X}", unicodedata.name(ch, "<no name>"))
For the plain lock character, the line you would expect from the Unicode name data is shown below. This is illustrative, not captured output. If the pasted text also contains a variation selector, a second line naming it should appear.
U+1F512 LOCK
In a browser console or Node.js, spreading a string into an array splits it by code point rather than by UTF-16 unit. This example prints each code point in U+ notation:
[..."🔒"].map(c => "U+" + c.codePointAt(0).toString(16).toUpperCase())
Reading encodings and escapes for U+1F512
Once you know the code point, you can write the same character in other forms. These values follow directly from the Unicode encoding rules for U+1F512:
| Form | Value |
| UTF-8 bytes | F0 9F 94 92 |
| UTF-16 code units | D83D DD12 |
| HTML hexadecimal entity | 🔒 |
| HTML decimal entity | 🔒 |
| JavaScript escape | \u{1F512} or \uD83D\uDD12 |
| Python escape | \U0001F512 |
Verifying the result
- Round trip: build the character from the code point you found (for example, chr(0x1F512) in Python) and compare it with the original string. If they are equal, the identification is correct.
- Length check: in JavaScript, "🔒".length returns 2 because the character uses two UTF-16 code units. This is expected and does not mean a hidden character is present. A count by code point, such as [..."🔒"].length, should return 1 for a bare lock.
- Hidden selectors: if the code point count is higher than expected, look for U+FE0F or U+FE0E. Removing either one changes how the lock is displayed but not which lock it is. Keep the selector if the display style matters to you.
- Search and replace: when matching locks in text, decide whether your pattern should also match the optional variation selector. Otherwise some instances may be missed or left half-replaced.
When the lock is not a standard Unicode character
Icon fonts often place a padlock glyph at a Private Use Area code point (U+E000 to U+F8FF). Unicode does not assign a meaning or name to those code points, so an inspector will show no name or a generic label. The same code point can show a lock in one font and something unrelated, or an empty box, in another. If you find a Private Use Area code point and need a portable lock, replace it with one of the standard characters listed above. If the inspector finds no character at all where the lock appears, the lock is an image or graphic, and a text tool cannot identify it.
Limits of this guide
No evidence was supplied about specific inspector products, their features or how platforms render these characters. This guide therefore names no tools and makes no claims about how a given device or font draws each lock. The code points, names and encodings above come from the Unicode Standard. The script outputs are illustrative and should be confirmed by running them on your own text.