CloudFormation JSON to YAML

Convert AWS CloudFormation templates to YAML that deploys exactly like the JSON original.

Output options

JSONinput

Empty

YAMLoutput

YAML output appears here

Runs entirely in your browser, so nothing is uploaded. Fair-use limits apply (5 MB per input, rate-limited conversions) to prevent spam and bots.

Load from URL

The file is fetched directly by your browser, so the server must allow cross-origin requests.

Keyboard shortcuts

Ctrl / ⌘ + Enter Convert now
Ctrl / ⌘ + S Download the output
Alt + Shift + C Copy the output
Alt + Shift + F Fix and format the JSON input
Alt + Shift + S Swap direction
Alt + Shift + T Cycle through code, tree and map views
Ctrl / ⌘ + Z Undo, including Format, Fix and Clear
Esc Leave full screen
Editor text size

Intrinsic functions stay valid

Ref, Fn::Sub and Fn::GetAtt are written in their full form, which CloudFormation reads in YAML exactly as in JSON.

Converter output (full form)
BucketName:
  Fn::Sub: assets-${Environment}
Tags:
  - Key: env
    Value:
      Ref: Environment
Resource:
  Fn::GetAtt:
    - AssetsBucket
    - Arn
Equivalent short form
BucketName: !Sub 'assets-${Environment}'
Tags:
  - Key: env
    Value: !Ref Environment
Resource: !GetAtt AssetsBucket.Arn

Both versions deploy identically. Short-form tags are a CloudFormation extension, so the converter keeps the full form that any YAML tool can read.

Smaller, easier-to-review templates

The sample template is 36% smaller as YAML than as pretty-printed JSON, with no braces or quotes to scan past in a review.

bash
# Validate the converted template with the AWS CLI
aws cloudformation validate-template --template-body file://template.yaml

CloudFormation details handled for you

Compare the converter's output with the same template values written by hand, without quotes.

Version dates

'2010-09-09' and '2012-10-17' stay strings rather than becoming YAML 1.1 dates.

Substitution strings

${AWS::AccountId} placeholders inside Fn::Sub are kept character for character.

Policy documents

Inline IAM policies convert like the rest of the template, so actions and resources read as clean lists.

More tools

Converters, validators and step-by-step guides for every place JSON and YAML meet.

Frequently asked questions

How do I convert a CloudFormation template from JSON to YAML?

Paste the template JSON or upload template.json. Copy the YAML or download template.yaml, then deploy it like any other template. Resources, parameters and outputs stay exactly the same.

Does the YAML use short-form functions like !Ref and !Sub?

No. The converter writes the full form (Ref:, Fn::Sub:, Fn::GetAtt:), which CloudFormation accepts in YAML templates and which every YAML parser can read. The short-form tags are optional shorthand.

Why is AWSTemplateFormatVersion quoted?

An unquoted 2010-09-09 is a date in YAML 1.1. CloudFormation expects the string, so the converter writes '2010-09-09'. IAM policy versions like '2012-10-17' are quoted for the same reason.

Can I convert a YAML template back to JSON?

Yes, for templates in full-form syntax: switch the direction to YAML → JSON. Templates written with short-form tags such as !Ref need a CloudFormation-aware tool, because those tags are not standard YAML types.

Is it safe to paste templates that include account details?

Yes. Conversion runs in your browser and nothing is uploaded or logged, so account IDs, ARNs and parameter defaults stay on your machine.