PowerShell - Base64 encoding and decoding

by
Jeremy Canfield |
Updated: February 02 2023
| PowerShell articles
Here is how you can convert a string (Hello World) into base64.
PS> [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('Hello World'))
SGVsbG8gV29ybGQ=
And here is how you can convert a base64 encoded string into cleartext.
PS> [Text.Encoding]::Utf8.GetString([Convert]::FromBase64String('SGVsbG8gV29ybGQ='))
Hello World
Did you find this article helpful?
If so, consider buying me a coffee over at