---
title: from json
categories: |
formats
version: 0.104.0
formats: |
Convert from json to structured data.
usage: |
Convert from json to structured data.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
# `from json` for [formats](/commands/categories/formats.md)
<div class='command-title'>Convert from json to structured data.</div>
## Signature
```> from json {flags} ```
## Flags
- `--objects, -o`: treat each line as a separate value
- `--strict, -s`: follow the json specification exactly
## Input/output types:
| input | output |
| ------ | ------ |
| string | any |
## Examples
Converts json formatted string to table
```nu
> '{ "a": 1 }' | from json
╭───┬───╮
│ a │ 1 │
╰───┴───╯
```
Converts json formatted string to table
```nu
> '{ "a": 1, "b": [1, 2] }' | from json
╭───┬───────────╮
│ a │ 1 │
│ │ ╭───┬───╮ │
│ b │ │ 0 │ 1 │ │
│ │ │ 1 │ 2 │ │
│ │ ╰───┴───╯ │
╰───┴───────────╯
```
Parse json strictly which will error on comments and trailing commas
```nu
> '{ "a": 1, "b": 2 }' | from json -s
╭───┬───╮
│ a │ 1 │
│ b │ 2 │
╰───┴───╯
```
Parse a stream of line-delimited JSON values
```nu
> '{ "a": 1 }
{ "b": 2 }' | from json --objects
╭───┬────┬────╮
│ # │ a │ b │
├───┼────┼────┤
│ 0 │ 1 │ ❎ │
│ 1 │ ❎ │ 2 │
╰───┴────┴────╯
```