---
schema_version: "1"
id: f89b1f46080d6f0bd808bfcf52fcd0a99dec68f8b5810c1e4b60de4651e1bd98
title: ASCII
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-func/ascii.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/ascii.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ed506a4c18226849ba9d136eac45e454a1232778cb079f770d2b611ba2ae9bc6
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `ASCII`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the ASCII code of the first character of a string. For UTF-8, returns the Unicode code point.

## Syntax

```sql
ascii(<string>)
```

## Arguments

### Required

- `<string>`: The string whose first character code is to be returned.

## Returns

Returns an integer representing the ASCII code or Unicode code point of the first character.

## Examples

### Get ASCII Code

Get the ASCII code of a character.

```sql
SELECT ascii('x') AS result;
```

Returns `120`, the ASCII code for 'x'.

## Related Documentation

- [String Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
