DocumentsImagesMediaPDF Tools

Convert CSV to YAML Online

Convert CSV tables to YAML configuration. Free, in your browser, no file uploads.


- nombre: Juan
    edad: 30
    ciudad: Madrid
- nombre: Maria
    edad: 25
    ciudad: Barcelona
- nombre: Carlos
    edad: 35
    ciudad: Valencia
Processed in your browser

CSV to YAML for configurations, inventories, and test data

Ansible inventories from Excel

Transform server spreadsheets into YAML inventories ready for Ansible.

Docker Compose configurations

Generate service configurations for Docker Compose from parameter tables.

Fixtures and test data

Convert QA test data sheets into YAML fixtures for pytest, RSpec, or Cypress.

100% private

Conversion runs in your browser. Your CSV is never sent to any server.

Three steps, no hassle

1

Paste or upload your CSV

Drag your .csv file or paste the content. The first row defines the YAML keys for each object.

2

Automatic conversion

Each CSV row becomes a YAML object within a sequence. Data types are automatically inferred.

3

Copy or download the YAML

Copy the generated YAML to the clipboard or download it as a .yaml file ready to use in your project.

Got questions?

The tool infers types automatically: values of 'true' or 'false' (unquoted) are converted to YAML booleans, numeric integer values to integers, decimal values to floats, and the rest remain as strings. This is important for compatibility with Ansible (which uses PyYAML/YAML 1.1) and with Kubernetes (which uses the Go parser, gopkg.in/yaml.v3, compatible with YAML 1.2). If a value like '007' must remain a string (for example, a country code), it needs to be quoted in the original CSV.

The main cases are: generating Ansible inventories from a server inventory spreadsheet (with columns like hostname, ip, group, user), creating docker-compose.yml files with multiple services from a configuration table, generating per-service environment variable configurations from an application parameter CSV, creating test data fixtures for pytest or RSpec from test data sheets shared with the QA team, and producing Helm values.yaml files for Kubernetes deployments from environment configuration tables.

The Ansible inventory in YAML format expects a specific structure with groups and hosts. If your CSV has columns like 'host', 'ip', 'group', and 'user', the direct conversion generates a flat list of objects. To get the hierarchical group structure that Ansible expects, the most useful result is a list of host-objects that you can process with a Python script using PyYAML, or use directly as a source for an Ansible dynamic inventory script. Many DevOps teams maintain the primary inventory in Google Sheets (exported to CSV) and sync with the Ansible inventory using exactly this workflow.

Yes, with important limitations. docker-compose.yml has a deeply nested structure (services > service_name > image, ports, environment, volumes) that doesn't map directly to a flat table. However, it's possible to generate the services section as a list of objects from a CSV with columns like 'name', 'image', 'port_host', 'port_container', and then use a template or script to convert that list to the final Compose format. This approach is useful for generating configurations for multiple environments (dev, staging, prod) from a central parameters table.

YAML has several special characters that can cause issues if they appear unescaped in values: a colon followed by a space (': ') is interpreted as a key-value separator, '#' starts a comment, '[', ']', '{', '}' are flow collection indicators, and '|' and '>' are block scalar indicators. The tool automatically quotes values containing these characters using double or single quotes as appropriate, generating valid YAML that is correctly parsed by any standard YAML 1.2 parser.

Yes, with the consideration that Ansible uses PyYAML which implements YAML 1.1, while Kubernetes uses gopkg.in/yaml.v3 which implements YAML 1.2. The most relevant practical difference is boolean handling: in YAML 1.1 'yes', 'no', 'on', 'off' are booleans; in YAML 1.2 only 'true' and 'false' (unquoted) are. The tool generates YAML compatible with both versions by exclusively using 'true' and 'false' as boolean literals, which are valid in both specifications.

Convert CSV to YAML: Ansible inventories, Docker Compose, and batch config generation

YAML (YAML Ain't Markup Language, specification 1.2 published October 1, 2009 at yaml.org) is the standard format for configuration files in the DevOps ecosystem: Ansible playbooks and inventories, Kubernetes manifests, GitHub Actions workflows, GitLab CI pipelines, docker-compose.yml, Helm values.yaml files, and application configurations in frameworks like Spring Boot (application.yml) or Ruby on Rails (database.yml). The need to generate YAML configurations in bulk from spreadsheets is recurring in platform engineering, DevOps, and SRE teams: when dozens of new servers are added to the infrastructure inventory (whose source of truth is an asset management spreadsheet), when a microservice is deployed across multiple environments with different parameters defined in a table, or when the QA team maintains their test data in Google Sheets and needs to generate it as YAML fixtures for automated tests.

The case of generating Ansible inventories from spreadsheets is especially common in teams adopting Ansible to automate the management of an existing infrastructure. Servers are already inventoried in spreadsheets or CMDBs (Configuration Management Databases) with information such as hostname, IP address, operating system, environment (production, staging, development), functional group (web, database, cache, monitoring), and server-specific variables. Exporting that spreadsheet to CSV and converting it to YAML generates the base of the Ansible inventory, which the team can refine by adding the group hierarchy and group variables. This workflow reduces to minutes what would otherwise require manually writing hundreds of lines of YAML. Similarly, generating Helm values.yaml files for multiple environments (dev, staging, pre-prod, prod, by geographic region) from a central parameters table allows maintaining a single source of truth in tabular format (easily auditable and editable by the entire team) and generating environment-specific YAML files reproducibly.

Another relevant use case is creating test data fixtures in YAML. Testing frameworks like pytest (through plugins like pytest-datadir or pytest-yaml), Ruby on Rails (which uses YAML fixtures since Rails 1.0 in December 2004 to populate the database in tests), and Cypress (which uses YAML or JSON fixtures to mock API responses) require test data in YAML or JSON format. QA teams typically define their test cases in shared Google Sheets, with columns representing fields of each test entity. Converting those sheets to CSV and then to YAML automatically generates fixtures that testing engineers can directly incorporate into the repository. Additionally, CSV to YAML conversion is the first step for migrating application configuration data from legacy formats (Java .properties files, .ini files, configuration database tables) to YAML, which is the preferred format for modern frameworks. Convertir.ai performs this transformation entirely in the browser, without software installation, without row limits, with automatic type inference and valid YAML generation per the 1.2 specification.