# LAX JSON conversion functions in BigQuery


So if you're looking to decompress after a long week and relax, check out the LAX conversion functions for handling JSON conversions in BigQuery.

There are 4 separate functions: `LAX_STRING`, `LAX_BOOL`, `LAX_FLOAT64`, `LAX_INT64` - with each one of them attempting to convert a JSON value into the respective datatype.

This is a bit like using SAFE\_CAST - you won't get an error if the casting fails, just a NULL (so watch out, check the comments for an example when this can come to back to bite you).

Just note that even JSON-like string won't work as an input, it only works for the native JSON type.

As usual, watch out because these conversion functions might work differently as how you'd expect. SAFE\_CAST('1' AS BOOL) =&gt; NULL but SAFE\_CAST(1 AS BOOL) =&gt; TRUE.

![](https://miro.medium.com/v2/resize:fit:700/0*Kqn0tqN5Q74Pfazw align="left")

*Found it useful? Subscribe to my Analytics newsletter at* [*notjustsql.com*](https://notjustsql.com)*.*

---

*Enjoyed this? Here are some related articles you might find useful:*

- [The JSON datatype in BigQuery](https://datawise.dev/the-json-datatype-in-bigquery)
- [JSON datatype vs JSON-like STRING in BigQuery](https://datawise.dev/json-datatype-vs-json-like-string-in-bigquery)
- [Flattening JSON arrays in BigQuery](https://datawise.dev/flattening-json-arrays-in-bigquery)
- [Extracting keys from JSON in BigQuery](https://datawise.dev/extracting-keys-from-json-in-bigquery)

