ENV ↔ JSON/YAML Converter
Convert between .env, JSON, and YAML formats
'\"%@]/.test(value);
const quotedValue = needsQuotes ? `\"${value}\"` : value;
yaml += `${spaces}${key}: ${quotedValue}\\n`;
}
}
return yaml;
},
loadExample() {
this.inputFormat = 'env';
this.outputFormat = 'json';
this.input = `# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=myapp
DB_USER=admin
DB_PASSWORD=\"my secret password\"
# Application Settings
APP_ENV=production
APP_DEBUG=false
APP_URL=https://example.com`;
this.convert();
},
copyOutput() {
navigator.clipboard.writeText(this.output);
},
swapFormats() {
const temp = this.inputFormat;
this.inputFormat = this.outputFormat;
this.outputFormat = temp;
this.input = this.output;
this.convert();
}
}">
Error
Features
- ✓ Convert between .env, JSON, and YAML formats
- ✓ Handles quoted values and special characters
- ✓ Preserves comments in supported formats
- ✓ Swap input/output formats with one click
- ⚠️ Client-side processing - your data never leaves your browser
Note: This tool is designed for simple key-value pairs. Complex nested structures may not be fully supported.