Remove HTML Formatting in Google Docs [Clear HTML Tags]

Written By Jason Andrews

Sometimes, when copying and pasting from various sources, such as websites or email, unwanted HTML formatting tags can also get into your document. It causes confusion and can become unreadable.

Fortunately, Google Docs has a range of options to regain control over your document and eliminate these HTML tags.remove-html-formatting-in-google-docs

In this article, I will provide different techniques to remove HTML formatting from your documents in Google Docs.

Let’s begin!

What are HTML Tags, and Why are they in Your Document?

HTML formatting plays a vital role in instructing a browser on how to render a web page. It is a component of Hyper Text Markup Language code. An HTML tag basically formats a text, changes its appearance, controls the alignment, and embeds content.

An HTML tag’s format has always been the same. You should understand it, especially when you are trying to separate text from HTML code.

The HTML starting tag and ending tag names are enclosed in angle brackets “< >”. But the ending tag has a forward slash ‘/’ after the opening angle bracket. For example, an HTML paragraph tag looks like this: <p> Your paragraph here. </p>

So, why are these HTML tags in your Google Docs?

It’s because when you copy something from a web page, you might unintentionally copy the HTML formatting as well.

But you don’t need to be too concerned regarding those tags, as you can easily get rid of HTML formatting in Google Docs.

How to Remove HTML Tags in Google Docs

To remove formatting & stripping HTML tags in Google Docs, you’ll need to press the Ctrl + \ (backslash) to clear formatting to remove all formatting from the document. Then, download the file in .html format and open it in a plain text editor. Now, just remove the HTML tags.

Below, I’ve provided several ways to clear Google Docs HTML tags.

Here are the methods to remove HTML tags in Google Docs:

1. Eliminate and Strip HTML Formatting

If you are working with a document filled with HTML tags, just download it in .html format. Then, open it with a plain text editor and find & remove the HTML formatting from there.

Here’s how to eliminate and strip HTML formatting in Google Docs:

  • Press Ctrl + A to highlight everything in your document.
  • Select Format from the top bar and choose Clear formatting. Or simply press Ctrl+ \ on the keyboard. google-docs-clear-formatting
  • Choose File and select Download > Web Page (.html, zipped).google-docs-download-html
  • Extract the downloaded file, and you’ll get your file in HTML format.
  • Open the HTML file in a plain text editor, preferably Notepad ++, or just use the Windows default Notepad app. But don’t open it in Microsoft Word.
  • Remove the style tag, which starts with <style …> and ends with </style> from the HTML file.html-style-remove
  • Click on Search from the top bar and choose Replace. notepad-replace
  • Enter ‘ class=”c0″’ in the Find what field. Don’t forget to put a space before ‘class’.
  • Keep the Replace with field empty and click the Replace All button.notepad-replace-html-tag
  • Remove all other classes, such as c1, c2, c3, … from the HTML file.

Repeat the process to find any HTML tag you want and replace it with an empty string to get rid of HTML Formatting from your document.

The above method allows you to choose the HTML tags you want to remove. But if you want to completely strip all the HTML formatting in Google Docs, follow the steps below.

2. Remove HTML Tags Using Find and Replace

You can use the Find and replace feature in Google Docs to capture all the HTML formatting in your document and erase them altogether.

To remove HTML tags using Find and replace in Google Docs:

  • Open your document filled with HTML formatting in Google Docs.
  • Click on Edit on the top bar and choose Find and replace. google-docs-find-and-replace
  • Input </?\S+?[^<>]*> in the Find field.
  • Keep the Replace with field empty so all the HTML tags are replaced with nothing.
  • Check the Use regular expressions option.
  • Click on the Replace all button.google-docs-find-and-replace-html-tags

Now, Google Docs will clear all HTML tags from your document, keeping just the text.

So why does ‘</?\S+?[^<>]*>’ magically capture all the HTML formatting and remove them?

The input you’ve provided in the Find field is a Regular expression also known as regex. It is a series of letters and symbols that look for a specific pattern.

In the </?\S+?[^<>]*> expression, the angle brackets will find HTML tags, the question mark (?) will find zero or one occurrence of ‘</’, \S+ will identify non-whitespace characters which can occur one or more times in your document.

[^<>] expression looks for characters within angle brackets whose starting position is ‘<’. Finally, the asterisk (*) will capture the preceding characters zero or more times.

So, basically, ‘</?\S+?[^<>]*>’ will find all the HTML tags, and then you can easily remove those tags by replacing them with an empty field in Google Docs.

FAQs

How to remove HTML formatting from Google Sheets?

To remove HTML tags in Google Sheets, select the cell beside the first cell with the HTML tag, input =REGEXREPLACE(the cell no. with HTML tag, “<[^<>]+>”,””) and press Enter. It will strip the HTML tags, and only the text between the tags will remain. Drag the cell downward to apply the formula to other cells and remove HTML formatting from them.

How to do code formatting in Google Docs?

To structure codes in Google Docs, select Insert from the top bar, choose building blocks > Code blocks, and pick your desired programming language. Alternatively, you can search for the specific language using the @ symbol.

How to get rid of weird formatting in Google Docs?

To get rid of different formatting in Google Docs, select Format from the top menu and choose Clear formatting. Or press Ctrl + \ on the keyboard.

Final Thoughts

Deleting HTML formatting in Google Docs will improve the readability and consistency of your document. If you are copying content from a web page or editing an HTML-filled doc, you can ensure that your file remains free from unwanted HTML formatting.

Comment below if you have further questions, and we’ll get back to you.

About The Author
Jason is a tech fanatic. He got his first computer when he was just 7 years old. Till then he's madly in love with computers, tech, and gaming.Jason completed his post-grad in electrical engineering from a well-reputed university.He's extremely passionate to share his tech findings with 10PCG.

Leave a Comment