Changing a File Extension
File extensions can be changed by renaming a document from the document browser by long pressing a document an selecting Rename.
While documents can be renamed from within the text editor, it is not possible to change a document's file extension. This is a limitation put in place by iOS to mitigate security concerns.
This is available on iOS 16 and newer.