How to Convert HTML to Markdown in Python? Last Updated : 03 Mar, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report Markdown is a way of writing a formatted text on the web. This article discusses how an HTML text can be converted to Markdown. We can easily convert HTML to markdown using markdownify package. So let's see how to download markdownify package and convert our HTML to markdown in python. Installation: This module does not come in-built with Python. To install it type the below command in the terminal. pip install markdownifyApproach Import moduleCreate HTML textUse markdownify() function and pass the text to itDisplay markdowned text Example 1: Python3 # import markdownify import markdownify # create html html = """ <h1> <strong>Geeks</strong> for<br> Geeks </h1> """ # print HTML print(html) # convert html to markdown h = markdownify.markdownify(html, heading_style="ATX") print(h) Output: <h1> <strong>Geeks</strong> for<br> Geeks </h1> # **Geeks** for Geeks Example 2: Python # import markdownify import markdownify # create html html = """ <h1>Fruits</h1> <ul> <li> apple </li> <li> banana </li> <li> orange </li> </ul> """ # print HTML print(html) # convert html to markdown h = markdownify.markdownify(html, heading_style="ATX") # print markdown print(h) Output: <h1>Fruits</h1> <ul> <li> apple </li> <li> banana </li> <li> orange </li> </ul> # Fruits * apple * banana * orange Comment More infoAdvertise with us Next Article How to write to an HTML file in Python ? S sidgautam Follow Improve Article Tags : Python python-modules Practice Tags : python Similar Reads Python Convert Html to PDF Convert HTML/webpage to PDF There are many websites that do not allow to download the content in form of pdf, they either ask to buy their premium version or don't have such download service in form of pdf. Conversion in 3 Steps from Webpage/HTML to PDF Step1: Download library pdfkit $ pip install p 1 min read How to make HTML files open in Chrome using Python? Prerequisites: Webbrowser HTML files contain Hypertext Markup Language (HTML), which is used to design and format the structure of a webpage. It is stored in a text format and contains tags that define the layout and content of the webpage. HTML files are widely used online and displayed in web brow 2 min read Parsel: How to Extract Text From HTML in Python Parsel is a Python library used for extracting data from HTML and XML documents. It provides tools for parsing, navigating, and extracting information using CSS selectors and XPath expressions. Parsel is particularly useful for web scraping tasks where you need to programmatically extract specific d 2 min read How to write to an HTML file in Python ? Python language has great uses today in almost every field, it can be used along with other technologies to make our lives easier. One such use of python is getting the data output in an HTML file. We can save any amount of our input data into an HTML file in python using the following examples in t 2 min read How to convert IPython notebooks to PDF and HTML? In this article, we will see how to convert IPython notebooks to PDF and HTML. Sometimes according to our necessity, we would want to share or convert the Jupyter notebook to HTML or pdf format. Our Jupyter Notebooks can be easily converted to PDF and HTML files. You may access your notebook as a PD 1 min read How to parse local HTML file in Python? Prerequisites: Beautifulsoup Parsing means dividing a file or input into pieces of information/data that can be stored for our personal use in the future. Sometimes, we need data from an existing file stored on our computers, parsing technique can be used in such cases. The parsing includes multiple 5 min read Like