"为了试尺码" can be translated into English as "to try on for size" or simply "to try the size".
"To try on for size" is a more common and idiomatic expression, especially in contexts like shopping for clothes or shoes, where you want to check if the item fits you properly.
"To try the size" is also correct but slightly more straightforward and might be used in more general or less idiomatic contexts.
For example:
I came to the store to try on for size. (我来店里试尺码。)
I need to try the size before buying these shoes. (我买这双鞋之前需要先试下尺码。)