JSON to PowerShell Converter
Convert JSON to PowerShell objects for PowerShell development
JSON Input
PowerShell Output
What Is JSON to PowerShell?
PowerShell has ConvertFrom-Json and ConvertTo-Json built in. This tool generates PowerShell object literals (hashtables, arrays) from your JSON so you can embed static data or create object templates in scripts. The JSON specification defines the input format.
Conversion runs in your browser. Set the variable name in the config panel. Nothing is sent to a server. For parsing JSON strings at runtime, use ConvertFrom-Json. This tool is for generating static PowerShell code from known JSON.
How to Use This Tool
Paste or Upload JSON
Paste your JSON or upload a file. Set the variable name in the config panel.
Review the PowerShell Output
The right panel shows generated PowerShell code. Use ConvertFrom-Json to parse JSON strings at runtime.
Copy or Download
Use Copy or Download. For formatting JSON first, use the JSON Formatter. For validation, use the JSON Validator.
JSON to PowerShell Examples
Here is an example of generating PowerShell objects from a JSON object.
Example: Subscriber record
JSON input:
Generated PowerShell output:
When JSON to PowerShell Helps
When writing Azure Automation, Windows admin scripts, or DevOps pipelines that need config from JSON, converting to PowerShell objects lets you embed the structure directly. For API responses or dynamic JSON, use ConvertFrom-Json at runtime. This tool is useful when you have static JSON (e.g. from a config file) and want to embed it as PowerShell hashtables. The PowerShell documentation covers scripting in depth. For Linux/macOS, use JSON to Shell instead.
Frequently Asked Questions
Hashtable vs PSCustomObject?
ConvertFrom-Json returns PSCustomObject by default. This tool generates hashtable-style syntax. Both work for structured data. Hashtables are mutable; PSCustomObject is often used for read-only config.
When should I use ConvertFrom-Json instead?
Use ConvertFrom-Json when the JSON is dynamic (e.g. from an API or file). Use this tool when you have static JSON and want to embed it as PowerShell code.
Is my data private?
Yes. Generation runs entirely in your browser. No JSON or code is sent to any server.
Can I use this in Azure Runbooks?
Yes. Azure Automation runbooks use PowerShell. The generated code works in runbooks. For parsing JSON from Azure API responses, use ConvertFrom-Json.
What about nested objects?
Nested JSON becomes nested hashtables. Access with $obj.key.nestedKey. The generator preserves the structure for complex hierarchies.
Related Tools
ConvertFrom-Json. ConvertTo-Json. JSON spec. MDN JSON. RFC 8259. PowerShell docs. Postman.