~ is the Unicode character TILDE, code point U+007E (decimal 126) in the Basic Latin block, added in Unicode 1.1. In HTML write ~, and in UTF-8 it is the single byte 7E.
Codes
| Where | How to write it |
|---|---|
| Code point | U+007E |
| Decimal | 126 |
| UTF-8 bytes | 7E |
| UTF-16 (big-endian) | 007E |
| UTF-32 | 0000007E |
| HTML decimal | ~ |
| HTML hex | ~ |
| CSS | \7E |
| JavaScript | \u007E |
| JSON | \u007E |
| Python | \u007E |
| Python by name | \N{TILDE} |
| Java, C# | \u007E |
| Rust, Swift | \u{7E} |
| Go, C, C++ | \u007E |
| URL (percent-encoded) | %7E |
JavaScript and JSON strings store text as UTF-16, so this character is one code unit long. Python 3 strings count code points, so its length there is 1.
Properties
| Property | Value |
|---|---|
| Name | TILDE |
| Code point | U+007E (decimal 126) |
| Block | Basic Latin (U+0000–U+007F) |
| General category | Sm: Math symbol |
| Script | Common |
| Bidirectional class | ON: Other neutral |
| Mirrored in right-to-left text | No |
| First in Unicode version | 1.1 |
Nearby in Basic Latin
- v U+0076 Latin Small Letter V
- w U+0077 Latin Small Letter W
- x U+0078 Latin Small Letter X
- y U+0079 Latin Small Letter Y
- z U+007A Latin Small Letter Z
- { U+007B Left Curly Bracket
- | U+007C Vertical Line
- } U+007D Right Curly Bracket
- U+007F Delete
All 128 characters: Basic Latin.
Official reference
Questions people ask
- What is the HTML code for ~?
- Use ~ (decimal) or ~ (hex).
- What is the UTF-8 encoding of U+007E?
- 7E (hex), 1 byte. In a URL it is %7E.
- How do I write U+007E in JavaScript or Python?
- JavaScript: \u007E. Python: \u007E.
Source
Unicode Character Database 18.0.0 (Unicode License v3); HTML entity names from the WHATWG HTML Standard (CC BY 4.0). The encodings above are computed from the code point and checked against Python's encoders. How the character looks depends on your fonts.
Legal entity
Devansh Yadav
Moradabad, Uttar Pradesh
Governing law: Courts at Moradabad, Uttar Pradesh
Phone: +91 8433475698
Legal: legal@analyzeit.in