# JSON\_UNQUOTE

## Syntax

```sql
JSON_UNQUOTE(val)
```

## Description

Unquotes a JSON value, returning a string, or `NULL` if the argument is null.

An error will occur if the given value begins and ends with double quotes and is an invalid JSON string literal.

If the given value is not a JSON string, value is passed through unmodified.

Certain character sequences have special meanings within a string. Usually, a backslash is ignored, but the escape sequences in the table below are recognised by MariaDB, unless the [SQL Mode](https://mariadb.com/docs/server/server-management/variables-and-modes/sql_mode) is set to `NO_BACKSLASH_ESCAPES` .

| Escape sequence | Character                          |
| --------------- | ---------------------------------- |
| "               | Double quote (")                   |
| \b              | Backslash                          |
| \f              | Formfeed                           |
| \n              | Newline (linefeed)                 |
| \r              | Carriage return                    |
| \t              | Tab                                |
| \\              | Backslash ()                       |
| \uXXXX          | UTF-8 bytes for Unicode value XXXX |

## Examples

```sql
SELECT JSON_UNQUOTE('"Monty"');
+-------------------------+
| JSON_UNQUOTE('"Monty"') |
+-------------------------+
| Monty                   |
+-------------------------+
```

With the default [SQL Mode](https://mariadb.com/docs/server/server-management/variables-and-modes/sql_mode):

```sql
SELECT JSON_UNQUOTE('Si\bng\ting');
+-----------------------------+
| JSON_UNQUOTE('Si\bng\ting') |
+-----------------------------+
| Sng	ing                   |
+-----------------------------+
```

Setting `NO_BACKSLASH_ESCAPES`:

```sql
SET @@sql_mode = 'NO_BACKSLASH_ESCAPES';

SELECT JSON_UNQUOTE('Si\bng\ting');
+-----------------------------+
| JSON_UNQUOTE('Si\bng\ting') |
+-----------------------------+
| Si\bng\ting                 |
+-----------------------------+
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_unquote.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
