It depends on where you're planning on removing the characters really. If you're using Javascript to build the JSON object then you can sanitise inputs or textareas by using regexp to match against potential whitespaces:
const value = textarea.value;
const regexp = /(<\s*br\s*\/?>|\s| )/ig;
const sanitised = value.replaceAll(regexp, '');
This won't account for other HTML elements however. If you want to make sure that HTML elements and HTML entities don't get rendered then you could consider sanitising the elements/entities as such:
const value = textarea.value;
const sanitised = value
.replaceAll('&', '&')
.replaceAll('<', '<')
.replaceAll('>', '>');