Json whitespace formatter
I think you need to ignore the contents of quoted values.

Add the flag:

    boolean inQuotes=false;


then, at the top of your if statement:

        if (c == '"') {
            inQuotes=!inQuotes;
        }
        if (!inQuotes) {
            if (c == '{') {
                sb.append(c);
                sb.append(System.lineSeparator());
                tabCount++;
                printTabs(sb, tabCount);
            } else if(c == '}') {
                ...  // Your code
        } else {
            sb.append(c);
        }