JSON to Java

Class name: Package name:

JSON to Java Tool

JSON to Java is an easy-to-use tool that converts JSON into Java classes by copying, pasting, and converting.

It provides the following features:

  1. Online generation of Java entity classes from JSON strings.
  2. Online generation of JavaBeans from JSON strings.
  3. Online generation of Java POJO objects from JSON strings.

How to use JSON to Java?

  1. Enter or paste your JSON string into the text area above.
  2. Click the "JSON to Java" button to generate your Java entity class code.
  3. Click the "Copy" button to paste it into your clipboard; you can also download the result file.

Tip: You can customize the Java class name and package name.

JSON to Java Class Example

Input JSON string:

{
"id":1,
"name":"John",
"age":24 }
Output Java class result:
package com.online.compiler.json2bean;

/**
* auto gen:2024-08-09 15:9:0
*
* @author www.online-compiler.com
* @website http://www.online-compiler.com/json/json2java/
*/
public class OnlineCompiler {

private int id;
private String name;
private int age;
public void setId(int id) {
this.id = id;
}
public int getId() {
return id;
}

public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}

public void setAge(int age) {
this.age = age;
}
public int getAge() {
return age;
}