# How to decode html to plain text

**URL:** <https://forums.pega.com/t/how-to-decode-html-to-plain-text/3523>\
**Category:** User Experience\
**Tags:** 8-7, dev-designer-studio, user-experience, case-management\
**Created:** [November 17, 2022, 10:20am UTC](https://forums.pega.com/t/how-to-decode-html-to-plain-text/3523 "2022-11-17T10:20:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxonL16591286](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@MaxonL16591286](https://forums.pega.com/u/MaxonL16591286)\
**Post date:** [November 17, 2022, 10:20am UTC](https://forums.pega.com/t/how-to-decode-html-to-plain-text/3523/1 "2022-11-17T10:20:46Z")

</div>

May I know how to decode html to plain text in most easi way?

E.g. for

_“_

# _aaa&nbsp;+bbb_
_”_

we expect to decode it to:

_“aaa +bbb”_

Currently we used pxReplaceAllViaRegex to do several replacement, but still some special case can not be covered.

One more issue is the pxReplaceAllViaRegex has a length limitation. If the match part longer than (maybe) 2293 byte, it will not work, am I correct?

Thanks.

---

<div class="post-metadata">

**Author:** ![mrits1](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/mrits1/32/12113_2.png) [@mrits1](https://forums.pega.com/u/mrits1)\
**Post date:** [November 17, 2022, 11:38am UTC](https://forums.pega.com/t/how-to-decode-html-to-plain-text/3523/2 "2022-11-17T11:38:28Z")

</div>

@MaxonL16591286 Hi are you using this in UI ? if yes then you can use a control RichTextDisplay that would help. If not please check the below link if that helps.

> **[Want To Convert A Rich Text Value To Plain Text Which is Present Clipboard...](https://support.pega.com/question/want-convert-rich-text-value-plain-text-which-present-clipboard-and-export-it-excel)**
>
> I have a functionality like i want to convert a rich text property to plain text. I am giving the property value for reference.

---

<div class="post-metadata">

**Author:** ![BhanuPrakash\_G](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@BhanuPrakash\_G](https://forums.pega.com/u/BhanuPrakash_G)\
**Post date:** [November 17, 2022, 11:49am UTC](https://forums.pega.com/t/how-to-decode-html-to-plain-text/3523/3 "2022-11-17T11:49:46Z")

</div>

@MaxonL16591286 You can make use of jsoup to convert html to plain text

 ![cap1.png](https://pega1.discourse-cdn.com/pega/original/2X/9/9e9b6d24e14ed1b47ee1a37e8f69d56e5118dbf1.png)

---

<div class="post-metadata">

**Author:** ![MaxonL16591286](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@MaxonL16591286](https://forums.pega.com/u/MaxonL16591286)\
**Post date:** [November 18, 2022, 1:55pm UTC](https://forums.pega.com/t/how-to-decode-html-to-plain-text/3523/4 "2022-11-18T13:55:20Z")

</div>

@BhanuPrakash_G

Fine, thanks!
