This PowerShell command will iterate through an entire web application to give you a list of all SharePoint sites and subsites in the web application.
Get-SPWebApplication "https://your-website.com" | Get-SPSite -Limit All | Get-SPWeb -Limit All | Select Title, URL, ID, ParentWebID | Export-CSV C:\Ehi\Sites\sites.csv -NoTypeInformation
The list is saved in .csv format. So you can open and explore the data in Excel.
The included fields are Title, URL, ID, and ParentWebID. But you can of course tweak the code to include/exclude fields as you like.