Paste Java HashMap, List, or Map.of() code on the left to generate JSON.
Try Java to JSON with sample input
Paste Java HashMap, List, or Map.of() code on the left to generate JSON.
Try Java to JSON with sample input
Paste Java HashMap, List, or Map.of() code on the left and copy or download JSON on the right.
Paste your Java data structure into the editor. Works with HashMap/ArrayList statements, Map.of(), List.of(), and double-brace initialization. Click "Sample" for a quick demo.
HashMap<String, Object> config = new HashMap<>();
config.put("host", "localhost");
config.put("port", 5432);
config.put("ssl", true);The converter parses your Java collections and produces formatted, valid JSON instantly. Nested structures, arrays, and all Java primitive types are handled automatically.
{
"host": "localhost",
"port": 5432,
"ssl": true
}Use "Copy" to copy JSON to your clipboard for immediate use in APIs or code, or "Download" to save it as a .json file.
Common questions about converting Java collections to JSON
Edit, format, and beautify JSON
Validate, fix, and inspect JSON
Compare, measure, and map JSON
Convert JSON to other formats
Convert other formats to JSON
Generate code and format other languages