SQLite 3 reference · String Functions

SQLite UNICODE() Function

Return the Unicode code point of the first character of a string, such as 65 for 'A'.

SQLite 3 Since 3.7.16

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

unicode(X)

Parameters

ParameterDescription
X The string (other values are converted to text).

Return value

An integer, or NULL for an empty string.

Examples

Code pointsTry it yourself
SELECT unicode('A') AS a, unicode('a') AS lower_a, unicode('é') AS e_acute;

Output

a | lower_a | e_acute
65 | 97 | 233
First letter's codeTry it yourself
SELECT name, unicode(name) AS first_code
FROM customers
LIMIT 3;

Output

name | first_code
Ada Lovelace | 65
Alan Turing | 65
Grace Hopper | 71

Version history

VersionChange
SQLite 3.7.16Added

In other languages

Was this page helpful?