---
title: "Validate JSON action for ActionClip"
canonical_url: "https://actionclip.app/actions/validate-json"
document_type: "standalone_action"
official: true
action_count: 1
catalog_schema_version: 1
catalog_revision: "2026-08-21.1"
catalog_published_at: "2026-08-20T18:50:00Z"
---

# Validate JSON action for ActionClip

Check whether selected text is valid JSON.

## What it does

Parses the complete selection and reports its top-level JSON type. Malformed input returns a specific JavaScript parsing error instead of changing the text.

## Action details

| Field | Value |
| --- | --- |
| Category | Developer Tools |
| Action type | JavaScript |
| Result | Copy the result |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **Validate JSON** — Selected text: [1, 2, {"ready": true}] | Valid JSON — array. |

## How to check whether selected text is valid JSON with ActionClip

1. Select the text you want to use.
2. Choose **Validate JSON** from ActionClip.
3. Review the result, then copy it where you need it.

## Requirements

No setup required.

## Privacy

Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

## Action configuration

````javascript
function run(selected_text) {
  let value;
  try {
    value = JSON.parse(selected_text);
  } catch (error) {
    throw new Error("Invalid JSON: " + error.message);
  }

  const kind = value === null ? "null" : Array.isArray(value) ? "array" : typeof value;
  return "Valid JSON — " + kind + ".";
}
````

## Links

- [HTML listing](https://actionclip.app/actions/validate-json)
- [Download action definition](https://actionclip.app/actions/validate-json.actionclip)
- [Browse Developer Tools actions](https://actionclip.app/marketplace#marketplace-developerTools)
- [All Marketplace listings](https://actionclip.app/marketplace)
