Sorafenib results in several adverse events, the mechanism and predictors of which are unknown. Recently, it was reported that metabolism by microbiome changes the structure and effects of drugs. The blood levels of sorafenib may be affected by enterohepatic recycling of sorafenib due to microbial enzymes in the gut. We evaluated the relationship between adverse events caused by sorafenib treatment and microbiome in patients with advanced hepatocellular carcinoma. Twenty-five patients were classified into two groups based on the presence of hand-foot syndrome (HFS) or diarrhea within 12 weeks post-sorafenib treatment. Before sorafenib treatment, the fecal samples were analyzed targeting the V3-V4 region of 16s ribosomal RNA. Microbiome and predicted functional gene were compared between two groups. The non-HFS group had a richer abundance of Veillonella, Bacillus, Enterobacter, Faecalibacterium, Lachnospira, Dialister, and Anaerostipes than the HFS group at genus level. Carotenoid biosynthesis and bacterial invasion of epithelial cells were enriched in the HFS group. The former three bacteria are classified as oral-origin bacteria, and the two predicted functions are associated with dysbiosis. The non-diarrhea group had a higher abundance of Butyricimonas and a lower abundance of Citrobacter, Peptostreptococcus, and Staphylococcaceae than the diarrhea group. Eight categories of predicted functional genes were detected with differences between the two groups. The non-HFS group had a higher relative abundance of oral-origin bacteria, which likely led to more robust dysbiosis in the gut. This dysbiosis may affect enterohepatic recycling. Additionally, the metabolism of these short-chain fatty acids in the gut may be different between the diarrhea and non-diarrhea groups.