How to Convert Map to JSON to HashMap in Java? code example Example: convert hashmap into json Gson gson = new Gson(); String json = gson.toJson(myObject);