Java → JSON
Convert Java log objects (Map, Lombok, Guava, ReflectionToString, Access Log) to JSON
Input0
Examples:
Output
0
About Java to JSON Converter
Convert Java object text representations to standard JSON. Supports six common formats:
1. Lombok @ToString — e.g.,
ClassName(field1=value1, field2=value2), auto-generated by Lombok annotations, most common in Spring Boot projects.
2. Java Map.toString() — e.g., {key1=value1, key2=value2}, output from HashMap, LinkedHashMap, and other Map implementations.
3. Java Class Definition (POJO/Bean) — e.g., public class UserDTO { ... }, generates a JSON schema example directly from the class definition.
4. Guava / Manual toString — e.g., ClassName{field1=value1, field2=value2}, output from Guava's MoreObjects.toStringHelper() or hand-written toString() methods.
5. Access Log — e.g., header:{...} params:{...}, common web framework access log format with automatic extraction of IP, TraceID, status code, and other metadata.
6. ReflectionToStringBuilder — e.g., ClassName@1a2b3c[field1=value1, field2=value2], output from Apache Commons Lang's ReflectionToStringBuilder.
The tool auto-detects the input format, supports extracting objects from full log lines (automatically skipping [IP][TraceID] prefixes), and recursively parses nested objects, arrays, and embedded JSON. Perfect for backend developers quickly analyzing data from logs.Frequently Asked Questions
What Java formats are supported?▼
Five formats are supported: Java Map's {key=value}, Lombok @ToString's ClassName(field=value), Guava/manual toString's ClassName{field=value}, Apache ReflectionToStringBuilder's ClassName@hash[field=value], and Access Log's key:{...} format. The tool auto-detects the input type.
Can it handle nested structures?▼
Yes, it recursively parses nested Maps, Lombok objects (e.g., OrderGuest(name=...)), arrays (e.g., [item1, item2]), and embedded JSON strings.
Can I paste full log lines directly?▼
Yes, the tool automatically skips log prefixes (IP, TraceID, thread name, log level, etc.) and extracts Java objects for parsing.