Chuyển một tệp .env sang JSON và JSON trở lại .env, theo cả hai chiều, hoàn toàn trong trình duyệt của bạn.
Cách dùng ENV / JSON
Chọn một chiều: .env sang JSON hoặc JSON sang .env.
Dán nội dung .env của bạn hoặc một đối tượng JSON.
Sao chép kết quả, hoặc hoán đổi để chuyển lại.
A two-way converter between .env files and JSON. Turn a .env file into a JSON object to inspect or edit it, or turn JSON back into a valid .env file, handling comments, the export prefix and quoted values.
Converting to JSON is useful for bulk-editing config, diffing two environments, or feeding settings into a tool that expects JSON; converting back produces a ready-to-use .env.
Because .env files hold secrets, privacy matters: the conversion runs entirely in your browser, so your environment variables and any keys in them never leave your device.
A .env file is the simple KEY=value list that apps load to configure themselves, database URLs, API keys, feature flags, kept out of the code and out of version control. It is the standard way to separate configuration from an application.
When reading a .env, comment lines starting with # and blank lines are ignored, an optional export prefix is removed, and surrounding quotes are stripped from values, so the JSON you get is clean and exactly the key-value pairs.
When writing a .env, values that contain spaces or special characters are wrapped in double quotes so they parse correctly in a shell or a dotenv loader, which avoids a common source of broken configuration.
Câu hỏi thường gặp
Các dòng chú thích bắt đầu bằng # và các dòng trống bị bỏ qua, tiền tố export tùy chọn bị loại bỏ, và dấu ngoặc kép bao quanh bị tước khỏi các giá trị.
Khi ghi .env, các giá trị chứa dấu cách hoặc ký tự đặc biệt được bọc trong dấu ngoặc kép để chúng phân tích đúng.
Không. Việc chuyển đổi chạy hoàn toàn trong trình duyệt của bạn, nên các biến môi trường của bạn không bao giờ rời khỏi thiết bị.
Nhúng công cụ này
Thêm công cụ này vào trang web của riêng bạn. Sao chép đoạn mã bên dưới; nó tự động cập nhật.
<iframe src="https://monu.tools/embed/vi/env-json-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>Công cụ liên quan
Tạo một HMAC cho một thông điệp và khóa secret bằng SHA-1, SHA-256, SHA-384 hoặc SHA-512, trong trình duyệt của bạn.
Băm một mật khẩu bằng bcrypt và xác minh một mật khẩu so với một hash bcrypt, hoàn toàn trong trình duyệt của bạn.
Chuyển một lệnh curl thành mã JavaScript fetch tương đương, hoàn toàn trong trình duyệt của bạn.
Chuyển JSON sang TOML và TOML trở lại JSON, theo cả hai chiều, hoàn toàn trong trình duyệt của bạn.