---
schema_version: "1"
id: 70eb2a6758a0de2b63415e0984dd963b6de826482ee54048973f79662778ce75
title: Char()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/string/mc-ampscript-reference-string-char.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-string/mc-ampscript-reference-string-char.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 648e0a2739e79a15fd2ef4adf8aa6ced1a7da39ac2f4b289559f1e4b020b77de
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Char()

Returns the character specified by the ASCII character code in the first parameter. An optional second parameter specifies the number of times to repeat the character.

This function supports the extended ASCII character set (codes 0–255).

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

## Syntax

```
Char(characterCode, numRepetitions)
```

The `Char()` function has two parameters:

- `characterCode` (string): Required. An ASCII character code.
- `numRepetitions` (number): The number of times to repeat the character.

## Usage

To use the function, pass it an ASCII character code.

```
Char(190)
```

The function returns `¾`.

### Repeating Characters

You can use the second parameter to repeat the specified character. This example repeats a character three times.

```
Char(65,3)
```

The function returns `AAA`.

### Referring to Unprintable Characters

This function is helpful for situations that require you to refer to unprintable characters. This example pulls content from a data extension. It then uses the `Replace()` function to replace the carriage return and line feed (CRLF) characters with an HTML `<br />` tag. The character code for the carriage return character is 13, and the code for line feed is 10.

```
%%[
  Var @content, @replacedContent
  Set @content = Lookup('ReplaceTest', 'Value', 'Key', '1')
  Set @replacedContent = Replace(@content, Concat(CHAR(13), CHAR(10)), '<br />')
]%%
<p>%%=v(@content)=%%</p>
<p>%%=v(@replacedContent)=%%</p>
```
