You look up the opcodes for each assembler instructions in the ISA specifications, like https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-.... Information about the machine code format starts at "2.2 Base Instruction Formats". The actual opcodes you can find in chapter 9,"RV32/64G Instruction Set Listings".
But be aware that some assembler instructions (called e.g. pseudo instructions) generate more than one.
The linked document is an old one, current ones are at https://riscv.org/technical/specifications/